TargetPrimitive

class guerilla.TargetPrimitive

Bases: guerilla.Locator

This class is the base for objects that can aim at a given position

getdirection()

Returns the direction to target

Returns:The target direction
Return type:point3
gettargetdistance()

Returns the target distance in local space

Returns:The target distance
Return type:number
gettargetposition()

Returns the position of the target in local space

Returns:The target position
Return type:point3
gettargetworldposition()

Returns the target position in world space

Returns:The target position
Return type:point3
getup()

Returns the node up vector

Returns:The up vector
Return type:point3
getworlddirection()

Returns the direction to target in world space

Returns:The target direction
Return type:point3
getworldmatrixorient()

Returns the local to world matrix of this node oriented on the Z axis according to the DirectionMode plug.

Returns:The Z oriented node matrix
Return type:matrix
getworldtolocalmatrixorient()

Returns the world to local matrix of this node oriented on the Z axis according to the DirectionMode plug.

Returns:The Z oriented node matrix
Return type:matrix
getworldtransformorient()

Returns the local to world transform of this node oriented on the Z axis according to the DirectionMode plug.

Returns:The Z oriented node transform
Return type:transform
getworldup()

Returns the node up vector

Returns:The up vector
Return type:point3
setworldpositiontargetup(position, target, up)

Sets the world position, target and up vector of the node

Parameters:
  • position (point3 or None) – the new world position or nil if left unchanged
  • target (point3 or None) – the new world target or nil if left unchanged
  • up (point3 or None) – the new world up vector or nil if left unchanged