TorqueScript Reference
|
#include <SceneObject_ScriptBinding.h>
Inherits BehaviorComponent.
Inherited by CompositeSprite, ParticlePlayer, ShapeVector, SpriteBase, TextSprite, Trigger, and WaveComposite.
Add the object to a scene.
scene | the scene you wish to add this object to. |
void applyAngularImpulse | ( | impulse | ) |
Applies an angular impulse.
impulse | - The impulse in Kg*m*m/s. |
void applyForce | ( | worldForce X/ | Y | ) |
Applies a force at a world point. If the force is not applied at the center of mass, it will generate a torque and affect the angular velocity.
worldForceX/Y | - The world force vector in Newtons (N). |
worldPointX/Y | - The world point where the force is applied. If world point is not specified, the center of mass is used. |
void applyLinearImpulse | ( | worldImpulse X/ | Y | ) |
Applies an impulse at a world point. This immediately modifies the linear velocity. It also modifies the angular velocity if the point of application is not the center of mass.
worldImpulse/Y | - The world impulse vector in Newtons (N-seconds) or Kg-m/s. |
worldPointX/Y | - The world point where the force is applied. If world point is not specified, the center of mass is used. |
void applyTorque | ( | torque | ) |
Applies a torque. This affects the angular velocity without affecting the linear velocity of the center of mass.
torque | - The torque in Newton-metres (N-m). |
void attachGui | ( | guiControl | guiObject, |
SceneWindow | window | ||
) |
Attach a GUI Control to the object.
guiObject | The GuiControl to attach. |
window | The SceneWindow to bind the GuiControl to. |
sizeControl | Whether or not to size the GuiControl to the size of this object. |
offset | The position offset to apply to the GuiControl. |
void cancelFadeTo | ( | ) |
Stop a previous 'fadeTo' command.
void cancelGrowTo | ( | ) |
Stop a previous 'growTo' command.
void cancelMoveTo | ( | ) |
Stop a previous 'moveTo' command.
autoStop? | - Whether to automatically set the linear velocity to zero or not |
void cancelRotateTo | ( | ) |
Stop a previous 'rotateTo' command.
autoStop? | - Whether to automatically set the angular velocity to zero or not |
void clearCollisionShapes | ( | ) |
Deletes all collision shapes.
void copyAllCollisionShapes | ( | targetObject | [, clearTargetShapes?] | ) |
Copies all collision shapes to the target object.
targetObject | - The target object to receive the collision shapes. |
clearTargetShapes | - Whether to clear the current collision shapes on the target or not. Optional: Defaults to true. |
Integer copyCollisionShape | ( | int | shapeIndex, |
targetObject | |||
) |
Copies a collision shape at the specified index to the target object.
shapeIndex | - The index of the collision shape. |
targetObject | - The target object to receive the collision shape copy. |
Boolean copyFrom | ( | SceneObject | object | ) |
Copies one scene object from another scene object. The object being copied to needs to be of the same class as the object being copied from.
object | The SceneObject to copy this object to. |
copyDynamicFields | Whether the dynamic fields should be copied or not. Optional: Defaults to false. |
Integer createChainCollisionShape | ( | localPointsX/ | Y | ) |
Creates a chain collision shape.
localPointsX/Y | A space separated list of local points for the chain collision shape (must be at least two points). |
adjacentLocalPositionStartXY | The adjacent local position of the start of the edge. |
adjacentLocalPositionEndXY | The adjacent local position of the end of the edge. |
Integer createCircleCollisionShape | ( | radius | ) |
Creates a circle collision shape.
radius | The radius of the circle. |
Integer createEdgeCollisionShape | ( | localPositionStartX | , |
localPositionStartY | , | ||
localPositionEndX | , | ||
localPositionEndY | |||
) |
Creates an edge collision shape.
localPositionStartXY | The local position of the start of the edge. |
localPositionEndXY | The local position of the end of the edge. |
adjacentLocalPositionStartXY | The adjacent local position of the start of the edge. |
adjacentLocalPositionEndXY | The adjacent local position of the end of the edge. |
Integer createPolygonBoxCollisionShape | ( | width | , |
height | |||
) |
Creates a polygon box collision shape.
width | The width of the box. |
height | The height of the box. |
localCentroidX/Y | The local position of the box centroid. |
angle | The angle of the box. |
Integer createPolygonCollisionShape | ( | localPointsX/ | Y | ) |
Creates a convex polygon collision shape.
localPointsX/Y | A space separated list of local points for the convex polygon collision shape (must be at least three points). |
Boolean deleteCollisionShape | ( | int | shapeIndex | ) |
Deletes the specified collision shape.
shapeIndex | - The index of the collision shape. |
void detachAllGuiControls | ( | ) |
Detach all GUI Controls.
void detachGui | ( | ) |
Detach any GUI Control.
ctrl | The SimObjectId of the GuiControl to detach. |
Boolean fadeTo | ( | targetColor red/green/blue/ | alpha, |
rate | |||
) |
Fades the object to the target color. The current color of the object will continue to change until it arrives at the target color or the fade is cancelled. The change will continue even if the blendColor is set directly.
(red | / green / blue / alpha) The target color to fade the object to. |
rate | The rate per second to change each color value. Must be a number greater than zero. |
Boolean fadeToTime | ( | targetColor red/green/blue/ | alpha, |
time | |||
) |
Fades the object to the target color over a period of time. The current color of the object will continue to change until it arrives at the target color or the fade is cancelled. The change will continue even if the blendColor is set directly which will change the amount of time it takes. Unhindered, each of the color values will arrive at the target in approximately the target time.
(red | / green / blue / alpha) The target color to fade the object to. |
time | The amount of time in milliseconds that each color value will take to reach the target. Must be a number greater than zero. |
String getAABB | ( | ) |
Gets the axis-aligned bounding-box of the object.
Boolean getActive | ( | ) |
Gets the body active status.
Float getAlphaTest | ( | ) |
Gets the render alpha test threshold.
Float getAngle | ( | ) |
Gets the object's angle.
Float getAngularDamping | ( | ) |
Gets the angular damping.
Float getAngularVelocity | ( | ) |
Gets Object Angular Velocity.
String getArea | ( | ) |
Gets the object's area.
String getAreaMax | ( | ... | ) |
Gets the lower right point of the object.
String getAreaMin | ( | ) |
Gets the upper left point of the object.
Boolean getAutoSizing | ( | ) |
Gets whether the object automatically sizes itself or not. You cannot set the size of an object that automatically sizes itself.
Boolean getAwake | ( | ) |
Gets whether the body is awake or not.
Float getBlendAlpha | ( | ) |
Gets the Rendering Alpha (transparency).
String getBlendColor | ( | allowColorNames | ) |
Gets the Rendering Blend color.
allowColorNames | Whether to allow stock color names to be returned or not. Optional: Defaults to false. |
Boolean getBlendMode | ( | ) |
Gets whether blending is on or not.
String getBodyType | ( | ) |
Gets the body type.
Boolean getBullet | ( | ) |
Gets whether the body is a bullet or not.
String getChainCollisionShapeAdjacentEnd | ( | int | shapeIndex | ) |
Gets whether the chain collision shape at the specified index has an adjacent end point or not.
shapeIndex | - The index of the collision shape. |
String getChainCollisionShapeAdjacentStart | ( | int | shapeIndex | ) |
Gets the adjacent start point of the chain collision shape at the specified index.
shapeIndex | - The index of the collision shape. |
Boolean getChainCollisionShapeHasAdjacentEnd | ( | int | shapeIndex | ) |
Gets whether the chain collision shape at the specified index has an adjacent end point or not.
shapeIndex | - The index of the collision shape. |
Boolean getChainCollisionShapeHasAdjacentStart | ( | int | shapeIndex | ) |
Gets whether the chain collision shape at the specified index has an adjacent start point or not.
shapeIndex | - The index of the collision shape. |
String getChainCollisionShapeLocalPoint | ( | int | shapeIndex, |
int | pointIndex | ||
) |
Gets the local point of a polygon collision shape at the specified index.
shapeIndex | - The index of the collision shape. |
pointIndex | - The index of the local point. |
Integer getChainCollisionShapePointCount | ( | int | shapeIndex | ) |
Gets the point count of a chain collision shape at the specified index.
shapeIndex | - The index of the collision shape. |
String getCircleCollisionShapeLocalPosition | ( | int | shapeIndex | ) |
Gets the local position of a circle collision shape at the specified index.
shapeIndex | - The index of the collision shape. |
Float getCircleCollisionShapeRadius | ( | int | shapeIndex | ) |
Gets the radius of a circle collision shape at the specified index.
shapeIndex | - The index of the collision shape. |
Boolean getCollisionCallback | ( | ) |
Gets whether the 'Scene::onCollision' callback is called or not.
String getCollisionGroups | ( | ) |
Gets the collision groups.
String getCollisionLayers | ( | ) |
Gets the collision layers.
String getCollisionMasks | ( | ... | ) |
Gets the collision group/layer masks.
Boolean getCollisionOneWay | ( | ) |
Gets the one way collision status for chain and edge shapes that belong to this object.
Float getCollisionShapeArea | ( | int | shapeIndex | ) |
Gets the area of collision shape at the specified index.
shapeIndex | - The index of the collision shape. |
Integer getCollisionShapeCount | ( | ) |
Gets the number of collision shapes.
Float getCollisionShapeDensity | ( | int | shapeIndex | ) |
Gets the density of the collision shape at the specified index.
shapeIndex | - The index of the collision shape. |
Float getCollisionShapeFriction | ( | int | shapeIndex | ) |
Gets the friction of the collision shape at the specified index.
shapeIndex | - The index of the collision shape. |
Boolean getCollisionShapeIsSensor | ( | int | shapeIndex | ) |
Gets whether the collision shape at the specified index is a sensor or not.
shapeIndex | - The index of the collision shape. |
Float getCollisionShapeRestitution | ( | int | shapeIndex | ) |
Gets the restitution of the collision shape at the specified index.
shapeIndex | - The index of the collision shape. |
String getCollisionShapeType | ( | int | shapeIndex | ) |
Gets the type of collision shape at the specified index.
shapeIndex | - The index of the collision shape. |
Boolean getCollisionSuppress | ( | ) |
Gets the collision suppress status.
String getContact | ( | contactIndex | ) |
Gets the contact at the specified contact index.
contactIndex | The contact at the specified index. |
Integer getContactCount | ( | ) |
Gets the current contact count. This will always be zero if contact gathering is off.
Float getDefaultDensity | ( | ) |
Gets the default density.
Float getDefaultFriction | ( | ) |
Gets the default friction.
Float getDefaultRestitution | ( | ) |
Gets the default restitution.
String getDstBlendFactor | ( | ) |
Gets the destination blend factor.
String getEdgeCollisionShapeAdjacentEnd | ( | int | shapeIndex | ) |
Gets whether the edge collision shape at the specified index has an adjacent end point or not.
shapeIndex | - The index of the collision shape. |
String getEdgeCollisionShapeAdjacentStart | ( | int | shapeIndex | ) |
Gets the adjacent start point of the edge collision shape at the specified index.
shapeIndex | - The index of the collision shape. |
Boolean getEdgeCollisionShapeHasAdjacentEnd | ( | int | shapeIndex | ) |
Gets whether the edge collision shape at the specified index has an adjacent end point or not.
shapeIndex | - The index of the collision shape. |
Boolean getEdgeCollisionShapeHasAdjacentStart | ( | int | shapeIndex | ) |
Gets whether the chain collision shape at the specified index has an adjacent start point or not.
shapeIndex | - The index of the collision shape. |
String getEdgeCollisionShapeLocalPositionEnd | ( | int | shapeIndex | ) |
Gets the local position end of the edge collision shape at the specified index.
shapeIndex | - The index of the collision shape. |
String getEdgeCollisionShapeLocalPositionStart | ( | int | shapeIndex | ) |
Gets the local position start of the edge collision shape at the specified index.
shapeIndex | - The index of the collision shape. |
Boolean getFixedAngle | ( | ) |
Gets whether the angle is fixed or not.
Boolean getGatherContacts | ( | ) |
Gets whether the gathering of contacts is active or not.
Float getGravityScale | ( | ) |
Gets the gravity scale.
Float getHeight | ( | ) |
Gets the height of the object.
Float getInertia | ( | ) |
Gets the rotation inertia of the body around the local origin.
Boolean getIsPointInCollisionShape | ( | int | shapeIndex, |
worldPointX/ | Y | ||
) |
Returns whether the world point intersects with the specified collision shape or not.
worldPointX/Y | The world point to check. |
shapeIndex | - The index of the collision shape. |
Boolean getIsPointInOOBB | ( | worldPointX/ | Y | ) |
Returns whether the world point intersects with the objects OOBB or not.
worldPointX/Y | The world point to check. |
Float getLifetime | ( | ) |
Gets the Objects Lifetime.
Float getLinearDamping | ( | ) |
Gets the linear damping.
String getLinearVelocity | ( | ) |
Gets Object Linear Velocity.
String getLinearVelocityFromLocalPoint | ( | localPointX/ | Y | ) |
Gets the linear velocity from a local point.
String getLinearVelocityFromWorldPoint | ( | worldPointX/ | Y | ) |
Gets the linear velocity from a world point.
String getLinearVelocityPolar | ( | ) |
Gets Objects Linear Velocity using Polar angle/speed.
Float getLinearVelocityX | ( | ) |
Gets Object Linear Velocity X.
Float getLinearVelocityY | ( | ) |
Gets Object Linear Velocity Y.
String getLocalCenter | ( | ) |
Gets the local center of mass.
String getLocalPoint | ( | float worldPointX/ | Y | ) |
Returns a local point from the world point. Converts a point in world space to local space.
worldPointX/Y | The world point to convert into a local point. |
String getLocalVector | ( | float worldVectorX/ | Y | ) |
Returns a local vector from the world vector. Converts a vector in world space to local space.
worldVectorX/Y | The world vector to convert into a vector point. |
Float getMass | ( | ) |
Gets the total mass of the body.
Boolean getPickingAllowed | ( | ) |
Gets whether picking is allowed or not.
String getPolygonCollisionShapeLocalPoint | ( | int | shapeIndex, |
int | pointIndex | ||
) |
Gets the local point of a polygon collision shape at the specified index.
shapeIndex | - The index of the collision shape. |
pointIndex | - The index of the local point. |
Integer getPolygonCollisionShapePointCount | ( | int | shapeIndex | ) |
Gets the point count of a polygon collision shape at the specified index.
shapeIndex | - The index of the collision shape. |
String getPosition | ( | ) |
Gets the object's position.
Float getPositionX | ( | ) |
Gets the object's position.
Float getPositionY | ( | ) |
Gets the object's position.
Float getRenderAngle | ( | ) |
Gets the object's render angle.
String getRenderGroup | ( | ) |
Gets the name of the render group used to sort the object during rendering.
String getRenderPosition | ( | ) |
Gets the current render position.
Integer getScene | ( | ) |
Get the scene the object is in.
Integer getSceneGroup | ( | ) |
Gets the Objects Group.
Integer getSceneLayer | ( | ) |
Gets the Objects Layer.
Float getSceneLayerDepth | ( | ) |
Gets the scene layer depth.
String getSize | ( | ) |
Gets the objects size.
Float getSizeX | ( | ) |
Gets the width of the object.
Float getSizeY | ( | ) |
Gets the height of the object.
Boolean getSleepingAllowed | ( | ) |
Gets whether the body is allowed to sleep or not.
Boolean getSleepingCallback | ( | ) |
Gets whether the 'onWake' and 'onSleep' callbacks are called or not when the object changes sleep state.
String getSortPoint | ( | ) |
Gets the layer draw order sorting point.
Float getSortPointX | ( | ) |
Gets the x component of the layer draw order sorting point.
Float getSortPointY | ( | ) |
Gets the y component of the layer draw order sorting point.
Integer getSoundatIndex | ( | ) |
Gets the handle of a sound at specified index
Index | - The Index of the sound (obtained via getSoundatIndex) |
Integer getSoundsCount | ( | ) |
gets the amount of sounds currently attached to a SceneObject
String getSrcBlendFactor | ( | ) |
Gets the source blend factor.
Boolean getUpdateCallback | ( | ) |
Gets whether the 'onUpdate' callback is called or not.
Boolean getUseInputEvents | ( | ) |
Gets whether input events are passed from the scene window are monitored by this object or not.
Boolean getVisible | ( | ) |
Gets the object's visible status.
Float getWidth | ( | ) |
Gets the width of the object.
String getWorldCenter | ( | ) |
Gets the world center of mass.
String getWorldPoint | ( | float localPointX/ | Y | ) |
Returns a world point from the local point. Converts a point in local space to world space.
localPointX/Y | The local point to convert into a world point. |
String getWorldVector | ( | float localVectorX/ | Y | ) |
Returns a world vector from the local vector. Converts a vector in local space to world space.
localVectorX/Y | The local vector to convert into a world vector. |
Boolean growTo | ( | targetSize width/ | height, |
rate rateX/ | rateY | ||
) |
Grows or shrinks the object to the target size. The current size of the object will continue to change until it arrives at the target size or the grow is cancelled. The change will continue even if the size is set directly.
(width | / height) The target size to grow or shrink the object to. |
(rateX | / rateY) The rate per second to change the size. Must be a number greater than zero even if shrinking. Can be one or two values. |
Boolean growToTime | ( | targetSize width/ | height, |
time | |||
) |
Grows or shrinks the object to the target size over a period of time. The current size of the object will continue to change until it arrives at the target size or the grow is cancelled. The change will continue even if the size is set directly which will change the amount of time it takes. Unhindered, both size values will arrive at the target in approximately the target time.
(width | / height) The target size to grow or shrink the object to. |
time | The amount of time in milliseconds that both size values will take to reach the target. Must be a number greater than zero. |
Boolean isFadeToComplete | ( | ) |
Gets whether a previous 'fadeTo' command has completed or not.
Boolean isGrowToComplete | ( | ) |
Gets whether a previous 'growTo' command has completed or not.
Boolean isMoveToComplete | ( | ) |
Gets whether a previous 'moveTo' command has completed or not.
Boolean isRotateToComplete | ( | ) |
Gets whether a previous 'rotateTo' command has completed or not.
Boolean moveTo | ( | worldPoint X/ | Y, |
speed | |||
) |
Moves the object to the specified world point. Linear velocity is applied to the object at the given speed in the direction of the target world point. The object may never reach the point if other forces act on the target such as collisions. If the object moves away from the target the object will stop checking to see if it has arrived at the target.
worldPointX/Y | The world point to move the object to. |
speed | The speed (in m/s) to use to move to the specified point. |
autoStop? | Whether to automatically set the linear velocity to zero when the object arrives at the target. |
snapToTarget? | Whether to snap the object to the target point when it is within the margin. |
margin? | The distance from the target that qualifies as reaching the target. |
Integer playSound | ( | ) |
Plays a sound at the object's location
AudioAsset | - The Audio Asset to play |
AudioDescription | - Sets the audio Description. If omitted, (optional) |
void removeFromScene | ( | ) |
Remove the object from the scene.
Boolean rotateTo | ( | angle | , |
speed | |||
) |
Rotates the object to the specified angle. The angle is rotated to by calculating the initial angular velocity required and applies it. The object may never reach the point if it has angular damping applied or collides with another object.
angle | The angle to rotate the object to. |
speed | The speed (in degree/s) to use to rotate to the specified angle. |
autoStop? | Whether to automatically set the angular velocity to zero when time has elapsed or not |
warpToTarget? | Whether to rotate instantly to the target angle after the specified time or not in-case the target was not quite reached. |
void safeDelete | ( | ) |
Safely deletes object.
void setActive | ( | ) |
Sets the body active status.
status | - Whether the body should be active or not (defaults to true). |
void setAlphaTest | ( | float | alpha | ) |
Set the render alpha test threshold.
alpha | The alpha test threshold in the range of 0.0 to 1.0. Less than zero to disable alpha testing. |
void setAngle | ( | float | angle | ) |
Sets the objects angle.
angle | The angle of the object. |
void setAngularDamping | ( | float | damping | ) |
Sets the angular damping.
damping | - The angular damping scale. |
void setAngularVelocity | ( | float | velocity | ) |
Sets Objects Angular Velocity.
velocity | The speed at which the object will rotate. |
void setArea | ( | float | x1, |
float | y1, | ||
float | x2, | ||
float | y2 | ||
) |
Sets the objects area.
x1 | The lower left corner x position. |
y1 | The lower left corner y position. |
x2 | The upper right corner x position. |
y2 | The upper right corner y position. |
void setAwake | ( | ) |
Sets whether the body is awake or not.
status | - Whether the body should be awake or not (defaults to true). |
void setBlendAlpha | ( | float | alpha | ) |
Sets the Rendering Alpha (transparency). The alpha value specifies directly the transparency of the image. A value of 1.0 will not affect the object and a value of 0.0 will make the object completely transparent.
alpha | The alpha value. |
void setBlendColor | ( | float | red, |
float | green, | ||
float | blue | ||
) |
or ( stockColorName ) - Sets the blend color.
red | The red value. |
green | The green value. |
blue | The blue value. |
alpha | The alpha value. |
void setBlendMode | ( | bool | blendMode | ) |
Sets whether blending is on or not. @blendMode Whether blending is on or not.
void setBodyType | ( | bodyType | type | ) |
Sets the body type.
void setBullet | ( | ) |
Sets whether the body is a bullet or not.
status | - Whether the body should be a bullet (fast moving body) or not (defaults to true). |
void setCollisionAgainst | ( | SceneObject | object | ) |
Sets the collision masks against a specific object.
object | The SceneObject to set collision masks against |
clearMasks | Whether or not to clear the collision masks before setting them against the object. |
void setCollisionCallback | ( | ) |
Sets whether the 'Scene::onCollision' callback is called or not. Sets whether whether the 'Scene::onCollision' callback is called or not.
status | Whether the 'Scene::onCollision' callback is called or not (default is false). |
void setCollisionGroups | ( | groups | ) |
Sets the collision group(s).
groups | A list of collision groups to collide with. |
void setCollisionLayers | ( | layers | ) |
Sets the collision layers(s).
layers | A list of layers to collide with. |
void setCollisionMasks | ( | groupMask | ) |
Sets the collision masks. Collision masks limit the objects that are collided with based on their scene group and scene Layer. In order for two objects to collide, the sending object must have the receiving object's Graph Group and Rendering Layer in its masks. The receiving object's masks, however, do not have to contain the sending object's Graph Group and Rendering Layer.
sceneGroupMask | The scene group(s) to enable collision with. |
sceneLayerMask | The scene layer(s) to enable collision with. If sceneLayerMask is not specified then all scene layers will be included. |
void setCollisionOneWay | ( | ) |
Sets the one way collision status for chain and edge shapes that belong to this object.
status | Whether collisions happen only in one direction or not (defaults to false). |
void setCollisionShapeDensity | ( | int | shapeIndex, |
float | density | ||
) |
Sets the density of the collision shape at the specified index.
shapeIndex | - The index of the collision shape. |
density | - The collision shape density. |
void setCollisionShapeFriction | ( | int | shapeIndex, |
float | friction | ||
) |
Sets the friction of the collision shape at the specified index.
shapeIndex | - The index of the collision shape. |
friction | - The collision shape friction. |
void setCollisionShapeIsSensor | ( | int | shapeIndex, |
bool | status | ||
) |
Sets whether the collision shape at the specified index is a sensor or not.
shapeIndex | - The index of the collision shape. |
status | - Whether the collision shape at the specified index is a sensor or not. |
void setCollisionShapeRestitution | ( | int | shapeIndex, |
float | restitution | ||
) |
Sets the restitution of the collision shape at the specified index.
shapeIndex | - The index of the collision shape. |
density | - The collision shape restitution. |
void setCollisionSuppress | ( | ) |
Sets the collision suppress status.
status | Whether to suppress the collision or not (defaults to true). |
void setDebugOff | ( | debugOptions | ) |
Sets Debug options(s) off.
debugOptions | Either a list of debug modes to turn off (comma-separated) or a string (space-separated) |
void setDebugOn | ( | debugOptions | ) |
Sets Debug option(s) on.
debugOptions | Either a list of debug modes (comma-separated), or a string with the modes (space-separated) |
void setDefaultDensity | ( | float | density | ) |
Sets the default density to use when creating collision shapes.
density | The default density to use when creating collision shapes. |
updateShapes | Whether to update the density on any existing shapes or not (default is true). |
void setDefaultFriction | ( | float | friction | ) |
Sets the default friction to use when creating collision shapes.
friction | The default friction to use when creating collision shapes. |
updateShapes | Whether to update the friction on any existing shapes or not (default is true). |
void setDefaultRestitution | ( | float | restitution | ) |
Sets the default restitution to use when creating collision shapes..
restitution | The default restitution to use when creating collision shapes. |
updateShapes | Whether to update the restitution on any existing shapes or not (default is true). |
void setDstBlendFactor | ( | dstBlend | ) |
Sets the destination blend factor.
dstBlend | The destination blend factor. |
void setEnabled | ( | bool | status | ) |
Enables or disables the object.
status | Whether to enable or disable the object. |
void setFixedAngle | ( | bool status? | ) |
Whether the object angle is fixed or not.
void setGatherContacts | ( | bool | gatherContacts | ) |
Sets whether to gather contacts or not.
gatherContacts | Whether to gather contacts or not. By default contact gather is off as it can become expensive if a lot of contacts are being processed. |
void setGravityScale | ( | float | scale | ) |
Sets the scaled world gravity.
scale | - The scaled world gravity. |
void setHeight | ( | float | height | ) |
Sets the height of the object.
height | The height of the object. |
void setLifetime | ( | float | lifetime | ) |
Set Objects' Lifetime.
lifetime | The amount of time, in seconds, before the object is automatically deleted. |
void setLinearDamping | ( | float | damping | ) |
Sets the linear damping.
damping | - The linear damping scale. |
void setLinearVelocity | ( | float | velocityX, |
float | velocityY | ||
) |
Sets Objects Linear Velocity. Sets the velocity at which the object will move.
velocityX | The x component of the velocity. |
velocityY | The y component of the velocity. |
void setLinearVelocityPolar | ( | float | angle, |
float | speed | ||
) |
Sets Objects Linear Velocity using Polar-speed. Sets the speed and direction at which the object will move. This has the same effect as setLinearVelocity(), it just sets the velocity in a different way.
angle | The angle of the direction at which the object to move. |
speed | The speed at which the object will move. |
void setLinearVelocityX | ( | float | velocityX | ) |
Sets Objects Linear Velocity X-Component.
velocityX | The x component of the velocity. |
void setLinearVelocityY | ( | float | velocityY | ) |
Sets Objects Linear Velocity Y-Component.
velocityY | The y component of the velocity. |
void setPickingAllowed | ( | bool | pickingAllowed | ) |
Sets whether picking is allowed or not.
pickingAllowed | Whether picking is allowed or not. |
void setPosition | ( | float | x, |
float | y | ||
) |
Sets the objects position.
x | The position of the object along the horizontal axis. |
y | The position of the object along the vertical axis. |
void setPositionX | ( | float | x | ) |
Sets the objects x position.
x | The horizontal position of the object. |
void setPositionY | ( | float | y | ) |
Sets the objects y position.
y | The vertical position of the object. |
void setRenderGroup | ( | renderGroup | ) |
Sets the name of the render group used to sort the object during rendering.
renderGroup | The name of the render group to use. Defaults to nothing. |
void setSceneGroup | ( | integer | group | ) |
Sets the objects group (0-31). The scene group to place the object in.
group | Integer in the range [0-31]. |
void setSceneLayer | ( | integer | layer | ) |
Sets the objects scene layer (0-31). The layer on which to place the object.
layer | Integer in the range [0-31]. |
void setSceneLayerDepth | ( | float | layerDepth | ) |
Sets the objects scene layer depth.
layerDepth | The layer depth can be any value. |
Boolean setSceneLayerDepthBack | ( | ) |
Sets the layer depth to be the back-most within the current layer..
Boolean setSceneLayerDepthBackward | ( | ) |
Sets the layer depth to be behind of the object currently behind within the current layer.
Boolean setSceneLayerDepthForward | ( | ) |
Sets the layer depth to be in-front of the object currently in-front within the current layer.
Boolean setSceneLayerDepthFront | ( | ) |
Sets the layer depth to be the front-most within the current layer..
void setSize | ( | float | width, |
float | height | ||
) |
Sets the objects size.
width | The width of the object. |
height | The height of the object. |
void setSizeX | ( | float | width | ) |
Sets the width of the object.
width | The width of the object. |
void setSizeY | ( | float | height | ) |
Sets the height of the object.
height | The height of the object. |
void setSleepingAllowed | ( | ) |
Sets whether the body is allowed to sleep or not.
status | - Whether sleeping is allowed on the body or not (defaults to true). |
void setSleepingCallback | ( | ) |
Sets whether the 'onWake' and 'onSleep' callbacks are called or not when the object changes sleep state. The object must be able to sleep (setSleepingAllowed) and have a 'dynamic' body mode for this callback to occur.
status | Whether the 'onWake' and 'onSleep' callbacks are called or not (default is false). |
void setSortPoint | ( | float | x, |
float | y | ||
) |
Sets the layer draw order sorting point.
x | The x position local to the object of the sort point. |
y | The y position local to the object of the sort point. |
void setSortPointX | ( | float | x | ) |
Sets the x-component of the layer draw order sorting point.
x | The x position local to the object of the sort point. |
void setSortPointY | ( | float | y | ) |
Sets the y-component of the layer draw order sorting point.
y | The y position local to the object of the sort point. |
void setSrcBlendFactor | ( | srcBlend | ) |
Sets the source blend factor.
srcBlend | The source blend factor. |
void setUpdateCallback | ( | ) |
Sets whether the 'onUpdate' callback is called or not.
status | Whether the 'onUpdate' callback is called or not (default is false). |
void setUseInputEvents | ( | bool | inputStatus | ) |
Sets whether input events are passed from the scene window are monitored by this object or not.
inputStatus | Whether input events are passed from the scene window are monitored by this object or not. |
void setVisible | ( | bool | status | ) |
Show or hide the object.
status | Whether to enable or disable visibility on the object. |
void setWidth | ( | float | width | ) |
Sets the width of the object.
width | The width of the object. |
void stopSound | ( | S32 | index | ) |
Stops a sound attached to a SceneObject
Index | - The Index of the sound (obtained via getSoundatIndex) |