Main   Class List   Namespace List   Wiki

TSStatic Class Reference
[Game Objects]

A static object derived from a 3D model file and placed within the game world. More...

Inheritance diagram for TSStatic:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void changeMaterial (string mapTo="", Material oldMat=NULL, Material newMat=NULL)
 Change one of the materials on the shape.
string getModelFile ()
 Get the model filename used by this shape.
int getTargetCount ()
 Get the number of materials in the shape.
string getTargetName (int index=0)
 Get the name of the indexed shape material.

Public Attributes

Collision

bool allowPlayerStep
 Allow a Player to walk up sloping polygons in the TSStatic (based on the collisionType).
TSMeshType collisionType
 The type of mesh data to use for collision queries.
TSMeshType decalType
 The type of mesh data used to clip decal polygons against.
Debug

int forceDetail
 Forces rendering to a particular detail level.
float renderNormals
 Debug rendering mode shows the normals for each point in the TSStatic's mesh.
Rendering

bool meshCulling
 Enables detailed culling of meshes within the TSStatic. Should only be used with large complex shapes like buildings which contain many submeshes.
bool originSort
 Enables translucent sorting of the TSStatic by its origin instead of the bounds.
bool playAmbient
 Enables automatic playing of the animation sequence named "ambient" (if it exists) when the TSStatic is loaded.
Media

filename shapeName
 Path and filename of the model file (.DTS, .DAE) to use for this TSStatic.

Static Public Attributes

static bool isRenderable
 Disables rendering of all instances of this type.
static bool isSelectable
 Disables selection of all instances of this type.

Detailed Description

A static object derived from a 3D model file and placed within the game world.

TSStatic is the most basic 3D shape in Torque. Unlike StaticShape it doesn't make use of a datablock. It derrives directly from SceneObject. This makes TSStatic extremely light weight, which is why the Tools use this class when you want to drop in a DTS or DAE object.

While a TSStatic doesn't provide any motion -- it stays were you initally put it -- it does allow for a single ambient animation sequence to play when the object is first added to the scene.

Example:
new TSStatic(Team1Base) {
   shapeName = "art/shapes/desertStructures/station01.dts";
   playAmbient = "1";
   receiveSunLight = "1";
   receiveLMLighting = "1";
   useCustomAmbientLighting = "0";
   customAmbientLighting = "0 0 0 1";
   collisionType = "Visible Mesh";
   decalType = "Collision Mesh";
   allowPlayerStep = "1";
   renderNormals = "0";
   forceDetail = "-1";
   position = "315.18 -180.418 244.313";
   rotation = "0 0 1 195.952";
   scale = "1 1 1";
   isRenderEnabled = "true";
   canSaveDynamicFields = "1";
};

Member Function Documentation

void TSStatic::changeMaterial ( string  mapTo = "",
Material  oldMat = NULL,
Material  newMat = NULL 
)

Change one of the materials on the shape.

This method changes materials per mapTo with others. The material that is being replaced is mapped to unmapped_mat as a part of this transition.

Note:
Warning, right now this only sort of works. It doesn't do a live update like it should.
Parameters:
mapTo the name of the material target to remap (from getTargetName)
oldMat the old Material that was mapped
newMat the new Material to map
Example:
// remap the first material in the shape
%mapTo = %obj.getTargetName( 0 );
%obj.changeMaterial( %mapTo, 0, MyMaterial );
string TSStatic::getModelFile (  ) 

Get the model filename used by this shape.

Returns:
the shape filename
Example:
// Acquire the model filename used on this shape.
%modelFilename = %obj.getModelFile();
int TSStatic::getTargetCount (  ) 

Get the number of materials in the shape.

Returns:
the number of materials in the shape.
See also:
getTargetName()
string TSStatic::getTargetName ( int  index = 0  ) 

Get the name of the indexed shape material.

Parameters:
index index of the material to get (valid range is 0 - getTargetCount()-1).
Returns:
the name of the indexed material.
See also:
getTargetCount()

Member Data Documentation

Allow a Player to walk up sloping polygons in the TSStatic (based on the collisionType).

When set to false, the slightest bump will stop the player from walking on top of the object.

The type of mesh data to use for collision queries.

The type of mesh data used to clip decal polygons against.

Forces rendering to a particular detail level.

bool TSStatic::isRenderable [static]

Disables rendering of all instances of this type.

Reimplemented from SceneObject.

bool TSStatic::isSelectable [static]

Disables selection of all instances of this type.

Reimplemented from SceneObject.

Enables detailed culling of meshes within the TSStatic. Should only be used with large complex shapes like buildings which contain many submeshes.

Enables translucent sorting of the TSStatic by its origin instead of the bounds.

Enables automatic playing of the animation sequence named "ambient" (if it exists) when the TSStatic is loaded.

Debug rendering mode shows the normals for each point in the TSStatic's mesh.

Path and filename of the model file (.DTS, .DAE) to use for this TSStatic.



Copyright © GarageGames, LLC. All Rights Reserved.