Actors API
- Function CreateAnimatedActor(mesh)
Returns a new animated actor composed of a mesh The mesh can either be created using CreateMesh() or Loaded using LoadMesh()
- Function CreateOctreeActor(mesh)
Returns a mesh actor optimized for large objects (such as levels)
- Function CreateCubeActor(cube_size)
Returns an actor with a cube mesh of the specified size ( cube_size x cube_size x cube_size )
- Function CreateSphereActor(radius)
Returns an actor composed of a sphere mesh
- Function CreateWaterActor(mesh, waveHeight, waveSpeed, waveLength)
Creates an actor with water properties set on a base mesh.
- Function CreateLightActor()
Returns a new light in the scene
- Function CreateBillboardActor()
Returns a billboard actor Billboard actors are flat textured planes that are always facing the camera.
- Function CreateTerrainActor(hmap_file$)
Returns terrain generated from a height map Note: Height Maps can be any supported image format
- Function CreateParticleActor(particle_type)
Returns a new particle actor.
Possible Particle Types:
- PARTICLE_TYPE_POINT
- PARTICLE_TYPE_BOX
- PARTICLE_TYPE_SPHERE
- PARTICLE_TYPE_CYLINDER
- PARTICLE_TYPE_MESH
- PARTICLE_TYPE_RING
- Function CreateProjectorActor()
Create a projector actor.
Projector actors can be used to project a texture over objects in its field of view.
- Function CreateCompositeActor()
Creates a composite actor.
Refer to the included Composite Demo for an example.
- Function CreateVehicleActor( chassis_actor )
Creates a vehicle actor. The chassis_actor is another actor that will be attached as the main body of the vehicle.
See also
- Sub DeleteActor( actor )
Removes an actor from the scene and frees its memory.
NOTE: Actors are all removed on clearScene so make sure you don't continue using the id after that.
- Sub GetActorTransform( actor, matrix )
Stores the actors absolute transformation in the given matrix.
- Sub SetActorPosition(actor, x, y, z)
Sets the absolute position of an actor
- Sub TranslateActorLocal(actor, x, y, z)
Moves an actor relative to its current position
- Sub TranslateActorWorld(actor, x, y, z)
Moves an actor relative to its current position
- Sub SetActorScale(actor, x, y, z)
Sets the scale of an actor.
- Sub ScaleActor(actor, x, y, z)
Multiplies the actor’s current scale by the vector given
See also
SetActorScale()
- Sub GetActorScale(actor, ByRef x, ByRef y, ByRef z)
Gets an actor’s scale
See also
SetActorScale()
- Sub SetActorRotation(actor, x, y, z)
Sets the rotation of an actor around each axis
See also
- Sub RotateActor(actor, x, y, z)
Rotates and actor a given number of degrees from its current orientation
See also
- Sub GetActorRotation(actor, ByRef x, ByRef y, ByRef z)
Gets the actors rotation on each axis
See also
- Sub SetActorVisible(actor, flag)
Returns true if an actor is visible
See also
ActorIsVisible()
- Function ActorIsVisible( actor )
-
Sets whether the actor is visible in the scene
SetActorVisible(actor, true)
Print "Actor solid state: "; ActorIsVisible(actor) 'Outputs 1
SetActorSolid(actor, false)
Print "Actor solid state: "; ActorIsSolid(actor) 'Outputs 0See also
SetActorVisible()
- Sub SetActorAutoCulling(actor, cull_type)
Sets the automatic culling state for an actor.
Possible Culling States:
- AUTOCULLING_OFF
- AUTOCULLING_BOX
- AUTOCULLING_FRUSTUM_BOX
- AUTOCULLING_FRUSTUM_SPHERE
- AUTOCULLING_OCC_QUERY
See also
- Function GetActorAutoCulling(actor)
Returns the automatic culling state for an actor.
Possible Culling States:
- AUTOCULLING_OFF
- AUTOCULLING_BOX
- AUTOCULLING_FRUSTUM_BOX
- AUTOCULLING_FRUSTUM_SPHERE
- AUTOCULLING_OCC_QUERY
See also
- Sub AddActorShadow(actor)
Cast a shadow on an actor during lighting calculations
Note: Also check the section on lights for more info
See also
- Sub RemoveActorShadow(actor)
Stops shadow casting on an actor
See also
- Function ActorExists(actor)
Returns true if the id passed is a valid actor.
- Function GetActorType(actor)
Returns an actor's type.
Actor Types:
- ACTOR_TYPE_NONE
- ACTOR_TYPE_MESH
- ACTOR_TYPE_OTMESH
- ACTOR_TYPE_LIGHT
- ACTOR_TYPE_TERRAIN
- ACTOR_TYPE_WATER
- ACTOR_TYPE_BILLBOARD
- ACTOR_TYPE_PARTICLE
- ACTOR_TYPE_PRIMITIVE
- ACTOR_TYPE_PROJECTOR
- ACTOR_TYPE_COMPOSITE
- ACTOR_TYPE_VEHICLE
NOTE: Cube and Sphere actors both return ACTOR_TYPE_PRIMITIVE