Callisto function reference  5.2
Object/group functions

Modules

 Animation functions
 
 Functions to create primitives
 
 Retrieve objects/groups
 

Functions

int CAL_ClearGroupOrientations (int groupID, bool subGroups=false)
 
int CAL_ClearGroupPositions (int groupID, bool subGroups=false)
 
int CAL_ClearGroupScalings (int groupID, bool subGroups=false)
 
int CAL_ClearGroupVisibilities (int groupID, bool subGroups=false)
 
int CAL_ClearObjectOrientations (int objID)
 
int CAL_ClearObjectPositions (int objID)
 
int CAL_ClearObjectScalings (int objID)
 
int CAL_ClearObjectVisibilities (int objID)
 
int CAL_CloneGroup (int *groupIDNew, int groupID, int parentID, bool colCheck, char *name="", bool cloneObjs=true)
 
int CAL_CloneGroupRecursive (int *newgroupIDs, int groupID, int parentID, int nr, int *ids, char **names=CAL_NULL, bool cloneObjs=true, bool keepColCap=false)
 
int CAL_CreateGroup (int *groupID, int parentID, bool colCheck, char *name="", bool collapsed=false)
 
int CAL_DestroyGroup (int groupID)
 
int CAL_DestroyObject (int objID)
 
int CAL_EmptyGroup (int groupID, bool subGroups=false)
 
int CAL_MoveGroup (int groupID, int parentID)
 
int CAL_MoveObject (int objID, int groupID)
 
int CAL_SetGroupActiveMaterial (int groupID, bool subGroups, int sID)
 
int CAL_SetGroupCastShadows (int groupID, bool castShadows, bool subGroups=false)
 
int CAL_SetGroupClearance (int groupID, CAL_scalar c)
 
int CAL_SetGroupCollisionCheckCapability (int groupID, bool colCapable, bool subGroups=false)
 
int CAL_SetGroupColor (int groupID, CAL_scalar red, CAL_scalar green, CAL_scalar blue, CAL_scalar alpha=1, bool receiveShadows=true, bool subGroups=false, int sID=0)
 
int CAL_SetGroupName (int groupID, char *name)
 
int CAL_SetGroupOrientationMatrix (int groupID, CAL_matrix3 mat, CAL_scalar time=-1)
 
int CAL_SetGroupOrientationQuaternion (int groupID, CAL_scalar x, CAL_scalar y, CAL_scalar z, CAL_scalar w, CAL_scalar time=-1)
 
int CAL_SetGroupPosition (int groupID, CAL_scalar x, CAL_scalar y, CAL_scalar z, CAL_scalar time=-1)
 
int CAL_SetGroupScaling (int groupID, CAL_scalar xScale, CAL_scalar yScale, CAL_scalar zScale, CAL_scalar time=-1)
 
int CAL_SetGroupTexture (int groupID, int textureID, CAL_scalar xtile, CAL_scalar ytile, CAL_scalar alpha=1, bool receiveShadows=true, bool subGroups=false, int sID=0)
 
int CAL_SetGroupVisibility (int groupID, int viewID, bool visible, CAL_scalar time=-1)
 
int CAL_SetObjectActiveMaterial (int objID, int sID)
 
int CAL_SetObjectCastShadows (int objID, bool castShadows)
 
int CAL_SetObjectClearance (int objID, CAL_scalar clearance)
 
int CAL_SetObjectColor (int objID, CAL_scalar red, CAL_scalar green, CAL_scalar blue, CAL_scalar alpha=1, bool receiveShadows=true, int sID=0)
 
int CAL_SetObjectOrientationEuler (int objID, CAL_scalar xRot, CAL_scalar yRot, CAL_scalar zRot, CAL_scalar time=-1)
 
int CAL_SetObjectOrientationMatrix (int objID, CAL_matrix3 mat, CAL_scalar time=-1)
 
int CAL_SetObjectOrientationQuaternion (int objID, CAL_scalar x, CAL_scalar y, CAL_scalar z, CAL_scalar w, CAL_scalar time=-1)
 
int CAL_SetObjectPosition (int objID, CAL_scalar x, CAL_scalar y, CAL_scalar z, CAL_scalar time=-1)
 
int CAL_SetObjectScaling (int objID, CAL_scalar xScale, CAL_scalar yScale, CAL_scalar zScale, CAL_scalar time=-1)
 
int CAL_SetObjectTexture (int objID, int textureID, CAL_scalar xtile, CAL_scalar ytile, CAL_scalar alpha=1, bool receiveShadows=true, int sID=0)
 
int CAL_SetObjectVisibility (int objID, int viewID, bool visible, CAL_scalar time=-1)
 
int CAL_SetObjectWorldMatrix (int objID, CAL_matrix4 *matrix, CAL_scalar time)
 

Detailed Description

Function Documentation

int CAL_ClearGroupOrientations ( int  groupID,
bool  subGroups = false 
)

Remove all orientations and keep group at current orientation.

Parameters
groupIDThe ID of the group.
subGroupsSet to TRUE if orientations of subgroups of group should also be removed, default is FALSE.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_ClearGroupPositions ( int  groupID,
bool  subGroups = false 
)

Remove all positions and keep group at current position.

Parameters
groupIDThe ID of the group.
subGroupsSet to TRUE if positions of subgroups of group should also be removed, default is FALSE.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_ClearGroupScalings ( int  groupID,
bool  subGroups = false 
)

Remove all scanlings and keep group at current scaling.

Parameters
groupIDThe ID of the group.
subGroupsSet to TRUE if scalings of subgroups of group should also be removed, default is FALSE.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_ClearGroupVisibilities ( int  groupID,
bool  subGroups = false 
)

Remove all visibilities and keep group at current visibility.

Parameters
groupIDThe ID of the group.
subGroupsSet to TRUE if visibilities of subgroups of group should also be removed, default is FALSE.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_ClearObjectOrientations ( int  objID)

Remove all orientations and keep object at current orientation.

Parameters
objIDThe ID of the object.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_ClearObjectPositions ( int  objID)

Remove all positions and keep object at current position.

Parameters
objIDThe ID of the object.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_ClearObjectScalings ( int  objID)

Remove all scanlings and keep object at current scaling.

Parameters
objIDThe ID of the object.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_ClearObjectVisibilities ( int  objID)

Remove all visibilities and keep object at current visibility.

Parameters
objIDThe ID of the object.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_CloneGroup ( int *  groupIDNew,
int  groupID,
int  parentID,
bool  colCheck,
char *  name = "",
bool  cloneObjs = true 
)

Clones a group including all objects.

Parameters
groupIDNewSet to the group ID of the clone.
groupIDThe ID of the group to clone.
parentIDThe parent group of the clone (0 for no parent).
colCheckSet to false if clone group does not need collision checks.
nameThe name of the group, default is no name.
cloneObjsOptional flag that indicates whether to clone the objects in the group as well.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_CloneGroupRecursive ( int *  newgroupIDs,
int  groupID,
int  parentID,
int  nr,
int *  ids,
char **  names = CAL_NULL,
bool  cloneObjs = true,
bool  keepColCap = false 
)

Clones a group including all objects and child groups.

Parameters
newgroupIDsList of new group IDs, can be NULL.
groupIDThe ID of the group to clone.
parentIDThe parent group of the clone (0 for no parent).
nrThe size of the ids and names lists, can be 0.
idsList of id's corresponding to the names list, can be NULL.
namesOptional list of new names for the clone, defaults to NULL.
cloneObjsOptional flag that indicates whether to clone the objects in the group as well, defaults to true.
keepColCapOptional flag that indicates whether the collision capabilities should be preserved. Default clones do not have collision check capabilities.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_CreateGroup ( int *  groupID,
int  parentID,
bool  colCheck,
char *  name = "",
bool  collapsed = false 
)

Creates an object group.

Parameters
groupIDThis is set to the group ID the group gets.
parentIDThe parent group of this group, use 0 if this group does not need a parent.
colCheckTrue if this group is used for collision checks, false if not.
nameThe name of the group as shown in the GUI, default is no name.
collapsedThe item will initially not be collapsed in the interface.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_DestroyGroup ( int  groupID)

Delets a group, its child groups and all its objects.

Parameters
groupIDThe ID of the group to delete.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_DestroyObject ( int  objID)

Destroys an object.

Parameters
objIDThe ID of the object to destroy.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_EmptyGroup ( int  groupID,
bool  subGroups = false 
)

Deletes a groups child groups and all its objects.

Parameters
groupIDThe ID of the group to empty.
subGroupsSet to TRUE if subgroups of group should also be removed, default is FALSE.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_MoveGroup ( int  groupID,
int  parentID 
)

Move a group to a new parent.

Parameters
groupIDThe ID of the group to move.
parentIDThe ID of the new parent.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_MoveObject ( int  objID,
int  groupID 
)

Move an object to another group.

Parameters
objIDThe ID of the object to destroy.
groupIDThe ID of the new group.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetGroupActiveMaterial ( int  groupID,
bool  subGroups,
int  sID 
)

Sets the active material of the group.

Parameters
groupIDThe ID of the group
subGroupsSet to true if subgroups also have to change the active material.
sIDThe ID of the new active material.
int CAL_SetGroupCastShadows ( int  groupID,
bool  castShadows,
bool  subGroups = false 
)

Set whether the objects of the group cast shadows. The default value is true. Casting is shadow is independent of the color/texture the object has.

Parameters
groupIDThe ID of the group.
castShadowsBoolean the states whether the objects should cast shadows or not.
subGroupsSet to TRUE if casting shadows of subgroups should also be set. Default is FALSE.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetGroupClearance ( int  groupID,
CAL_scalar  c 
)

Spherically expand a group. Collision will occur with the set of points whose distance to the objects is at most the clearance. This function overrules individual group clearance.

Parameters
groupIDThe ID of the group to translate.
cThe clearance.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetGroupCollisionCheckCapability ( int  groupID,
bool  colCapable,
bool  subGroups = false 
)

Sets the collision check capability of a group.

Parameters
groupIDThe ID of the group.
colCapableTrue if the group can be collision checked.
subGroupsSet to true if subgroups also have to change their collision check capability recursively.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetGroupColor ( int  groupID,
CAL_scalar  red,
CAL_scalar  green,
CAL_scalar  blue,
CAL_scalar  alpha = 1,
bool  receiveShadows = true,
bool  subGroups = false,
int  sID = 0 
)

Sets the color of a group.

Parameters
groupIDThe ID of the group.
redThe red component of the color (0...1).
greenThe green component of the color (0...1).
blueThe blue component of the color (0...1).
alphaThe alpha value of the color (0...1), 0 is fully transparant, 1 is fully opaque. Default is 1.
receiveShadowsSet when the objects need to receive shadows from other objects.
subGroupsSet to TRUE if subgroups of group should also get new color, default is FALSE.
sIDThe ID of the material which gets this color, default is material 0.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetGroupName ( int  groupID,
char *  name 
)

Change the name of a group.

Parameters
groupIDThe ID of the group.
nameThe new name
int CAL_SetGroupOrientationMatrix ( int  groupID,
CAL_matrix3  mat,
CAL_scalar  time = -1 
)

Set the group orientation using a rotation matrix for a specific time. If time is specified, the spherical linear interpolation (SLERP) algorithm is used for interpolation.

Parameters
groupIDThe ID of the group to rotate.
matThe 3x3 matrix to set the orientation.
timeThe time at which the group should have the orientation. If multiple orientations are defined (for different times), Callisto uses the SLERP algorithm to determine the orientation of the group given the current time. A single orientation at time 0 defines the group to be static regardless of the time.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetGroupOrientationQuaternion ( int  groupID,
CAL_scalar  x,
CAL_scalar  y,
CAL_scalar  z,
CAL_scalar  w,
CAL_scalar  time = -1 
)

Set the group orientation using a quaternion for a specific time. If time is specified, the spherical linear interpolation (SLERP) algorithm is used for interpolation.

Parameters
groupIDThe ID of the group to rotate.
xThe x component of the quaternion.
yThe y component of the quaternion.
zThe z component of the quaternion.
wThe w component of the quaternion.
timeThe time at which the group should have the orientation. If multiple orientations are defined (for different times), Callisto uses the SLERP algorithm to determine the orientation of the group given the current time. A single orientation at time 0 defines the group to be static regardless of the time.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetGroupPosition ( int  groupID,
CAL_scalar  x,
CAL_scalar  y,
CAL_scalar  z,
CAL_scalar  time = -1 
)

Place a group and all its objects at a new position. The order in which Callisto processes is scale, orientation, position. Therefore position is influenced by scale and orientation (and also those of parent groups).

Parameters
groupIDThe ID of the group to translate.
xThe x component of the new position.
yThe y component of the new position.
zThe z component of the new position.
timeThe time the group should be at the position. If multiple positions are defined (for different times), Callisto uses linear interpolation to determine the position of the group given the current time. A single position at time 0 defines the group to be static regardless of the time.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetGroupScaling ( int  groupID,
CAL_scalar  xScale,
CAL_scalar  yScale,
CAL_scalar  zScale,
CAL_scalar  time = -1 
)

Scale a group and all its objects.

Parameters
groupIDThe ID of the group to scale.
xScaleThe scaling factor in the x direction.
yScaleThe scaling factor in the y direction.
zScaleThe scaling factor in the z direction.
timeThe time at which the group should have the scaling. If multiple scalings are defined (for different times), Callisto uses linear interpolation to determine the scaling of the group given the current time. A single scaling at time 0 defines the group to be static regardless of the time.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetGroupTexture ( int  groupID,
int  textureID,
CAL_scalar  xtile,
CAL_scalar  ytile,
CAL_scalar  alpha = 1,
bool  receiveShadows = true,
bool  subGroups = false,
int  sID = 0 
)

Set the texture for a group.

Parameters
groupIDThe ID of the group.
textureIDThe ID of the texture.
xtileThe number of times to repeat the texture in the x-direction.
ytileThe number of times to repeat the texture in the y-direction.
alphaThe alpha value of the color (0...1), 0 is fully transparant, 1 is fully opaque. Default is 1.
receiveShadowsSet when the objects need to receive shadows from other objects.
subGroupsSet to TRUE if subgroups of group should also get new color. Default is FALSE.
sIDThe ID of the material which gets this texture, default is material 0.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetGroupVisibility ( int  groupID,
int  viewID,
bool  visible,
CAL_scalar  time = -1 
)

Set the group visibility for a specific view and time. Whether the group is actually visible is also determined by the visibilty of the parent group. Parent visibility takes priority over group visibility.

Parameters
groupIDThe ID of the group.
viewIDThe ID of the view.
visibleBoolean that states whether the group should be visibile or not.
timeThe time at which the group should be (in)visible. A single visibility at time 0 defines the group to be always visible or invisible regardless of the time.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetObjectActiveMaterial ( int  objID,
int  sID 
)

Sets the active material of the group.

Parameters
objIDThe ID of the object.
sIDThe ID of the new active material.
int CAL_SetObjectCastShadows ( int  objID,
bool  castShadows 
)

Set whether the object casts shadow. The default value is true. Casting is shadow is independent of the color/texture the object has.

Parameters
objIDThe ID of the object.
castShadowsBoolean the states whether the object should cast shadows or not.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetObjectClearance ( int  objID,
CAL_scalar  clearance 
)

Spherically expand an object. Collision will occur with the set of points whose distance to the object is at most the clearance. If CAL_SetGroupClearance is called later, individual object clearance will be overruled.

Parameters
objIDThe ID of the object to translate.
clearanceThe clearance.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetObjectColor ( int  objID,
CAL_scalar  red,
CAL_scalar  green,
CAL_scalar  blue,
CAL_scalar  alpha = 1,
bool  receiveShadows = true,
int  sID = 0 
)

Sets the color of an object.

Parameters
objIDThe ID of the object.
redThe red component of the color (0...1).
greenThe green component of the color (0...1).
blueThe blue component of the color (0...1).
alphaThe alpha value of the color (0...1), 0 is fully transparant, 1 is fully opaque. Default is 1.
receiveShadowsSet when the object needs to receive shadows from other objects.
sIDThe ID of the material which gets this color. Default value is material 0.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetObjectOrientationEuler ( int  objID,
CAL_scalar  xRot,
CAL_scalar  yRot,
CAL_scalar  zRot,
CAL_scalar  time = -1 
)

Set the object orientation using Euler angles (in radians) for a specific time. If time is specified, the spherical linear interpolation (SLERP) algorithm is used for interpolation.

Parameters
objIDThe ID of the object to translate.
xRotThe orientation with respect to the x-axis;
yRotThe orientation with respect to the y-axis;
zRotThe orientation with respect to the z-axis;
timeThe time at which the object should have the orientation. If multiple orientations are defined (for different times), Callisto uses the SLERP algorithm to determine the orientation of the object given the current time. A single orientation at time 0 defines the object to be static regardless of the time.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetObjectOrientationMatrix ( int  objID,
CAL_matrix3  mat,
CAL_scalar  time = -1 
)

Set the object orientation using a rotation matrix for a specific time. If time is specified, the spherical linear interpolation (SLERP) algorithm is used for interpolation.

Parameters
objIDThe ID of the object to rotate.
matThe 3x3 matrix to set the orientation.
timeThe time at which the object should have the orientation. If multiple orientations are defined (for different times), Callisto uses the SLERP algorithm to determine the orientation of the object given the current time. A single orientation at time 0 defines the object to be static regardless of the time.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetObjectOrientationQuaternion ( int  objID,
CAL_scalar  x,
CAL_scalar  y,
CAL_scalar  z,
CAL_scalar  w,
CAL_scalar  time = -1 
)

Set the object orientation using a quaternion for a specific time. If time is specified, the spherical linear interpolation (SLERP) algorithm is used for interpolation.

Parameters
objIDThe ID of the object to rotate.
xThe x component of the quaternion.
yThe y component of the quaternion.
zThe z component of the quaternion.
wThe w component of the quaternion.
timeThe time at which the object should have the orientation. If multiple orientations are defined (for different times), Callisto uses the SLERP algorithm to determine the orientation of the object given the current time. A single orientation at time 0 defines the object to be static regardless of the time.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetObjectPosition ( int  objID,
CAL_scalar  x,
CAL_scalar  y,
CAL_scalar  z,
CAL_scalar  time = -1 
)

Set the object at a new position for a specific time.

Parameters
objIDThe ID of the object to translate.
xThe x component of the new position.
yThe y component of the new position.
zThe z component of the new position.
timeThe time the object should be at the position. If multiple positions are defined (for different times), Callisto uses linear interpolation to determine the position of the object given the current time. A single position at time 0 defines the object to be static regardless of the time.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetObjectScaling ( int  objID,
CAL_scalar  xScale,
CAL_scalar  yScale,
CAL_scalar  zScale,
CAL_scalar  time = -1 
)

Set the object scaling for a specific time.

Parameters
objIDThe ID of the object to scale.
xScaleThe scaling factor in the x direction.
yScaleThe scaling factor in the y direction.
zScaleThe scaling factor in the z direction.
timeThe time at which the object should have the scaling. If multiple scalings are defined (for different times), Callisto uses linear interpolation to determine the scaling of the object given the current time. A single scaling at time 0 defines the object to be static regardless of the time.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetObjectTexture ( int  objID,
int  textureID,
CAL_scalar  xtile,
CAL_scalar  ytile,
CAL_scalar  alpha = 1,
bool  receiveShadows = true,
int  sID = 0 
)

Set the texture for an object.

Parameters
objIDThe ID of the object.
textureIDThe ID of the texture.
xtileThe number of times to repeat the texture in the x-direction.
ytileThe number of times to repeat the texture in the y-direction.
alphaThe alpha value of the color (0...1), 0 is fully transparant, 1 is fully opaque. Default is 1.
receiveShadowsSet when the object needs to receive shadows from other objects.
sIDThe ID of the material which gets this texture, default is material 0.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetObjectVisibility ( int  objID,
int  viewID,
bool  visible,
CAL_scalar  time = -1 
)

Set the object visibility for a specific time. Whether the object is actually visible is also determined by the visibilty of its group. Group visibility takes priority over object visibility.

Parameters
objIDThe ID of the object to scale.
viewIDThe ID of the view.
visibleBoolean that states whether the object should be visibile or not.
timeThe time at which the object should be (in)visible. A single visibility at time 0 defines the object to be always visible or invisible regardless of the time.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetObjectWorldMatrix ( int  objID,
CAL_matrix4 matrix,
CAL_scalar  time 
)

Set the WORLD matrix of an object. This works even when group matrix is set.

Parameters
objIDThe ID of the object.
matrixShould be of type CAL_matrix;
timeThe time at which the object should have the world matrix.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.