Python scripting - Common operators

CENPyOlpTouchSensingOperator

Previous  Chapter  Next

 

The object of the CENPyOlpTouchSensingOperator class can be obtain withing the CENPyOlpEvent_EventComputeOperator

that is passed to the PostCompute callback in the %EVENT_NAME%.py script file.

 

[Example]

 

def PostCompute(Operator):

   tsOperator = Operator.GetTouchSensingOperator()

  

    

Methods

 

 

GetCollisionPoint(frame: int): CENPyOlpMatrix

 

o

frame

Touch direction along Normal (0) or BaseFrame (1).

 

o

return

Collision point matrix.

 

Get collision point matrix.

 

[Example]

   matrix = tsOperator.GetCollisionPoint(1)

 


 

GetStartPoint(frame: int): CENPyOlpMatrix

 

o

frame

Touch direction along Normal (0) or BaseFrame (1).

 

o

return

Start point matrix.

 

Get start point matrix.

 

[Example]

   matrix = tsOperator.GetStartPoint(1)

 


 

GetEndPoint(frame: int): CENPyOlpMatrix

 

o

frame

Touch direction along Normal (0) or BaseFrame (1).

 

o

return

End point matrix.

 

Get end point matrix.

 

[Example]

   matrix = tsOperator.GetEndPoint(1)

 


 

GetReferencePoint(): CENPyOlpMatrix

 

o

return

Reference point matrix.

 

Get reference point matrix.

 

[Example]

   matrix = tsOperator.GetReferencePoint()

 


 

SetTouchStartDistance(startDist: float)

 

o

startDist

Offset reference point in direction of the surface normal.

 

Set touch start distance.

 

[Example]

   tsOperator.SetTouchStartDistance(0.2)

 


 

SetTouchEndDistance(endDist: float)

 

o

endDist

Offset reference point in minus direction of the surface normal.

 

Set touch end distance.

 

[Example]

   tsOperator.SetTouchEndDistance(0.1)

 


 

TouchPointCompute()

 

Compute touch point.

 

[Example]

   tsOperator.TouchPointCompute()

 


 

GetTouchLocationType(): int

 

o

return

Touch location type: AtStart (1) or AtEnd (2).

 

Calculate touch point near PG start or end.

 

[Example]

   locationType = tsOperator.GetTouchLocationType()

 


 

GetLastTouchDir(): int

 

o

return

BaseFrame touch axis: Undefined (0), XMinus (1), XPlus (2), YMinus (3), YPlus (4), ZMinus (5), ZPlus (6).

 

Get last touch direction.

 

[Example]

   lastTouchDir = tsOperator.GetLastTouchDir()

 


 

 


Previous
Previous page
Chapter
Chapter page
Next
Next page