TrackTo actuator: increasing up & track axis options #34861

Closed
opened 2013-04-04 00:58:20 +02:00 by Jorge Bernal · 10 comments
Member

%%%Hi,

I have uploaded a patch that increases the options for up & track axis in the TrackTo actuator.
With the patch applied you can select X, Y and Z axis for the Up axis, and X, Y, Z, -X, -Y and -Z for the track axis.

I have also uploaded 2 screenshots showing the UI modifications to the TrackTo actuator.

Related to the implementation I have used the algorithm from Trackto constrain placed in constrain.c but adapted to be used with MOTO library.

Regards,
Jorge

%%%

%%%Hi, I have uploaded a patch that increases the options for up & track axis in the TrackTo actuator. With the patch applied you can select X, Y and Z axis for the Up axis, and X, Y, Z, -X, -Y and -Z for the track axis. I have also uploaded 2 screenshots showing the UI modifications to the TrackTo actuator. Related to the implementation I have used the algorithm from Trackto constrain placed in constrain.c but adapted to be used with MOTO library. Regards, Jorge %%%
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'

%%%I can see and set the combo boxes:

  • Up Axis - passes
  • Track Axis - passes

Manual testing:
Running with default settings (Z,Y) - passed

Z,Y - passed
Z,X - passed
Z,Z - no tracking - passed
Z,-X - passed
Z,-Y - passed
Z, -Z - no tracking - passed

X,X - no tracking - passed
X,Y - passed
X,Z - passed
X,-X - no tracking - passed
X,-Y - passed
X,-Z - passed

Y,X - passed
Y,Y - no tracking - passed
Y,Z - passed
Y,-X - passed
Y,-Y - no tracking - passed
Y,-Z - passed

Python binding:

Attributes:

  • trackaxis would be better camel case trackAxis according to the conventions
  • upaxis would be better camel case upAxis according to the conventions

Reading trackaxis:

  • "X" -> 0
  • "Y" -> 1
  • "Z" -> 2
  • "-X" -> 3
  • "-Y" -> 4
  • "-Z" -> 5

passed all tests

Reading upaxis:

  • "X" -> 0
  • "Y" -> 1
  • "Z" -> 2

passed all tests

Setting attributes

  • upaxis: 1-> 0
  • trackaxis: 1->2

passed

I miss some constants for a better usage similar to these: http://www.blender.org/documentation/blender_python_api_2_66_6/bge.logic.html?highlight=axis#ray-sensor
Example: bge.logic.KX_TRACK_AXIS_X, bge.logic.KX_UP_AXIS_NEG_X

%%%

%%%I can see and set the combo boxes: * Up Axis - passes * Track Axis - passes Manual testing: Running with default settings (Z,Y) - passed Z,Y - passed Z,X - passed Z,Z - no tracking - passed Z,-X - passed Z,-Y - passed Z, -Z - no tracking - passed X,X - no tracking - passed X,Y - passed X,Z - passed X,-X - no tracking - passed X,-Y - passed X,-Z - passed Y,X - passed Y,Y - no tracking - passed Y,Z - passed Y,-X - passed Y,-Y - no tracking - passed Y,-Z - passed Python binding: Attributes: * trackaxis would be better camel case trackAxis according to the conventions * upaxis would be better camel case upAxis according to the conventions Reading trackaxis: - "X" -> 0 - "Y" -> 1 - "Z" -> 2 - "-X" -> 3 - "-Y" -> 4 - "-Z" -> 5 # passed all tests Reading upaxis: - "X" -> 0 - "Y" -> 1 - "Z" -> 2 # passed all tests Setting attributes - upaxis: 1-> 0 - trackaxis: 1->2 # passed I miss some constants for a better usage similar to these: http://www.blender.org/documentation/blender_python_api_2_66_6/bge.logic.html?highlight=axis#ray-sensor Example: bge.logic.KX_TRACK_AXIS_X, bge.logic.KX_UP_AXIS_NEG_X %%%
Author
Member

%%%Hi Monster,

I just uploaded a new patch including your suggestions (attributes names according to the conventions and use of constants).
Thanks for review it.

Regards,
Jorge%%%

%%%Hi Monster, I just uploaded a new patch including your suggestions (attributes names according to the conventions and use of constants). Thanks for review it. Regards, Jorge%%%

%%%Overall this is a pretty good patch, and it means these options are no longer hidden in the object properties, and it allows multiple tracking axis per object (e.g., multiple actuators). Although, I'm wondering if the MoTo changes should be in a separate patch. Also, Python constants that are for something specific like a logic brick usually have a part of the brick name in the constant name (e.g., KX_RANDOMACT_BOOL_CONST is a constant for the random actuator).%%%

%%%Overall this is a pretty good patch, and it means these options are no longer hidden in the object properties, and it allows multiple tracking axis per object (e.g., multiple actuators). Although, I'm wondering if the MoTo changes should be in a separate patch. Also, Python constants that are for something specific like a logic brick usually have a part of the brick name in the constant name (e.g., KX_RANDOMACT_BOOL_CONST is a constant for the random actuator).%%%
Author
Member

%%%Hi Moguri,

Thanks for review it.

I have just uploaded 3 new patches including your suggestions:

1 - rev3-all: same as rev2 (including MoTo changes) except python constants that they are now: KX_TRACK_UPAXIS_XXX and KX_TRACK_TRAXIS_XXX
2 - rev3-MoTo: MoTo libraries changes only
3 - rev3-track: same as rev2 except MoTo part removed and with modified python constants, that they are now: KX_TRACK_UPAXIS_XXX and KX_TRACK_TRAXIS_XXX

Regards,
Jorge%%%

%%%Hi Moguri, Thanks for review it. I have just uploaded 3 new patches including your suggestions: 1 - rev3-all: same as rev2 (including MoTo changes) except python constants that they are now: KX_TRACK_UPAXIS_XXX and KX_TRACK_TRAXIS_XXX 2 - rev3-MoTo: MoTo libraries changes only 3 - rev3-track: same as rev2 except MoTo part removed and with modified python constants, that they are now: KX_TRACK_UPAXIS_XXX and KX_TRACK_TRAXIS_XXX Regards, Jorge%%%

%%%+1 to me (in the functionality, I didn't look at the code).
Mitchell, do you think you have time to commit this? (prior to 2.69)

[worth noticing is that a recent patch/bug fix for the axis was committed last weeks - just to avoid any regression]%%%

%%%+1 to me (in the functionality, I didn't look at the code). Mitchell, do you think you have time to commit this? (prior to 2.69) [worth noticing is that a recent patch/bug fix for the axis was committed last weeks - just to avoid any regression]%%%
Author
Member

%%%Only to comment that I have created a doc here (http://wiki.blender.org/index.php/User:Lordloki/Doc:2.6/Manual/Game_Engine/Logic/Actuators/Edit_Object#Trackto_Actuator) showing the new feature%%%

%%%Only to comment that I have created a doc here (http://wiki.blender.org/index.php/User:Lordloki/Doc:2.6/Manual/Game_Engine/Logic/Actuators/Edit_Object#Trackto_Actuator) showing the new feature%%%
Author
Member

Hi,
I have just uploaded the 3 patches updated for 2.70 version. I hope that it can be included in this revision:

1 - rev4-MoTo: MoTo libraries changes only
2 - rev4-Track: Trackto changes only without MoTo library ones.
3 - rev4-all: all the changes, MoTo library + Trackto

Trackto_patch_MoTo_part_rev4.txt

Trackto_patch_Track_part_rev4.txt

Trackto_patch_all_rev4.txt

Regards and thanks in advance,
Jorge

Hi, I have just uploaded the 3 patches updated for 2.70 version. I hope that it can be included in this revision: 1 - rev4-MoTo: MoTo libraries changes only 2 - rev4-Track: Trackto changes only without MoTo library ones. 3 - rev4-all: all the changes, MoTo library + Trackto [Trackto_patch_MoTo_part_rev4.txt](https://archive.blender.org/developer/F82286/Trackto_patch_MoTo_part_rev4.txt) [Trackto_patch_Track_part_rev4.txt](https://archive.blender.org/developer/F82287/Trackto_patch_Track_part_rev4.txt) [Trackto_patch_all_rev4.txt](https://archive.blender.org/developer/F82288/Trackto_patch_all_rev4.txt) Regards and thanks in advance, Jorge

Closing this report since the patch was moved to Differential (D565).

Closing this report since the patch was moved to Differential ([D565](https://archive.blender.org/developer/D565)).

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Mitchell Stokes self-assigned this 2014-07-11 08:49:40 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#34861
No description provided.