movable root

 Function Name  Parameter  Return  Explain
getLocalBoundingBox None bbox Get bounding box in object space
getInvMatrix None matrix  
getStyle None dword  
setStyle dword None  
getRotation None vec rot Retrieves the orientation of the movable object.

Return Values

rot.x : pitch -- around the x-axis
rot.y
: yaw -- around the y-axis
rot.z
: roll -- around the z-axis

setRotation vec None Sets  the orientation of the movable object.
getScale None vec  
setScale vec None  
getMaterial None material  
setMaterial material None  
intersectRay ray ray
boolean bCalcDis, bIgnoreBack
1). boolean bInter
2). boolean bInter
     number fDistance
     number nTriIdx

 

Detects the intersection between a movable object and a ray.

Parameters

ray :  a ray
bCalcDis : whether calculate distance from ray's start to point of intersection.
bIgnoreBack : whether ignore backward faces of the movable object.

Return Values

1. If bCalcDis is false, returns boolean indicate whether intersected.


2. If bCalcDis is true, returns:
bInter : whether intersected
fDistance : the distance between ray's start and point of intersection.
nTriIdx : The index of intersected triangle.

 
intersectSegment segment seg
boolean bCalcDis, bIgnoreBack
1). boolean bInter
2). boolean bInter
     number fDistance
     number nTriIdx
Detects the intersection between a movable object and a segment.
getParent None movable mov
string type
if type is 'mobile', then mov is mobile
if type is 'skinmesh' then mov is skinmesh
if type is 'cloth' then mov is cloth
if type is 'group' then mov is movgroup
if no parent, then return nil.
setParent movable mov None Set parent, mov can be nil
getChildrenHead None dword Retrieves sub movables
getChildrenNext dword movable mov
dword pos
string type
if type is 'mobile', then mov is mobile
if type is 'skinmesh' then mov is skinmesh
if type is 'cloth' then mov is cloth
if type is 'group' then mov is movgroup
setMatrix matrix None Carefully use the function, it will not update the position & rotation parameters.
cloneInstance None object if failed, return nil; otherwise clone a instanced object and return a Script Variable.
bind skinmesh skinmesh
number
nBone
None bind self to specified skinmesh.
getBind None skinmesh skinmesh
number
nBone
get bind info; if no bind, return nil.


Styles List:

MOVS_FIXED -- fixed position, cast static shadow
MOVS_NOCLIP -- not affect collision detection
MOVS_SHADOW -- cast dynamic projected shadow
MOVS_SHADOW_REVERSE  -- reverse shadow
MOVS_SHADOWMAP  -- use a ready image as shadow map
MOVS_HOLLOW -- for collision detection, movtar can get out from inner of a hollow object.

MOVS_DOUBLESIDE  -- double sided (only valid for cloth currently)