Torque 3D - Script Manual: InteriorInstance Class Reference

TorqueScript

Main   Class List   Namespace List   Online

InteriorInstance Class Reference
[Game Objects]

Object used to represent buildings and other architectural structures (legacy). More...

Inheritance diagram for InteriorInstance:

List of all members.

Public Member Functions

void changeMaterial (string mapTo, Material oldMat, Material newMat)
 Change one of the materials on the shape.
void exportToCollada (bool bakeTransform)
 Exports the Interior to a Collada file.
string getModelFile ()
 Get the interior file name.
int getNumDetailLevels ()
 Get the number of detail levels interior was created with.
int getTargetCount (int detailLevel)
 Get the number of materials used by interior.
string getTargetName (int detailLevel, int targetNum)
 Get the name of the indexed shape material.
void setAlarmMode (string alarmMode)
 This sets the alarm mode of the interior.
void setDetailLevel (int level)
 Manually changes the current detail level, rather than automatically via view distance.

Public Attributes

Media

filename interiorFile
 Path and filename of the Interior file (.DIF) to load for this InteriorInstance.
Zoning

int zoneGroup
 ID of group the zone is part of.

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

Object used to represent buildings and other architectural structures (legacy).

Interiors are made up entirely from convex hulls or, as they are more commonly known as by game artists, brushes. So what you see is what you collide against. There is no difference between the visible meshes and the collision meshes.

Unlike a DTS or COLLADA mesh, interiors do not support any animation. They also do not support transparent textures. If you need animation or transparency then you are forced to use other model objects.

It is important to note that interiors are no longer the preferred format for large structures. It is an old format, which does not have much to offer above DTS or COLLADA. They are still included in Torque 3D for the sake of backwards compatibility for developers porting older TGE or TGEA projects. It will be deprecated soon.


Member Function Documentation

void InteriorInstance::changeMaterial ( string  mapTo,
Material  oldMat,
Material  newMat 
)

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 = %interiorObject.getTargetName( 0 );
%interiorObject.changeMaterial( %mapTo, 0, MyMaterial );
void InteriorInstance::exportToCollada ( bool  bakeTransform  ) 

Exports the Interior to a Collada file.

Parameters:
bakeTransform Bakes the InteriorInstance's transform into the vertex positions
Example:
// Export to COLLADA, do not bakeTransform
%interiorObject.exportToCollada(0);
string InteriorInstance::getModelFile (  ) 

Get the interior file name.

Returns:
The name of the interior's model file in .DIF.
Example:
%interiorObject.getModelFile();
int InteriorInstance::getNumDetailLevels (  ) 

Get the number of detail levels interior was created with.

Example:
%numLODs = %interiorObject.getNumDetailLevels();
echo(%numLODs);
int InteriorInstance::getTargetCount ( int  detailLevel  ) 

Get the number of materials used by interior.

Parameters:
detailLevel Interior level of detail to scan
Returns:
The number of materials used by the interior at a specified detail level
Example:
// Find materials used at first level of detail
%targetCount = %interiorObject.getTargetCount(1);
echo(%targetCount);
string InteriorInstance::getTargetName ( int  detailLevel,
int  targetNum 
)

Get the name of the indexed shape material.

Parameters:
detailLevel Target LOD
targetNum Index mapped to the target
Returns:
The name of the target (material) at the specified detail level and index
Example:
// First level of detail, top of the index map
%targetName = %interiorObject.getTargetName(1, 0);
echo(%targetName);
void InteriorInstance::setAlarmMode ( string  alarmMode  ) 

This sets the alarm mode of the interior.

The alarm mode is used when debugging bad geometry for an interior. When on, the the bad verties will be rendered a different color.

Parameters:
alarmMode If true the interior will be in an alarm state next frame. Options are 'On' or 'Off'.
Example:
// Turn on alarm mode debugging for interior
%interiorObject.setAlarmMode("On");
void InteriorInstance::setDetailLevel ( int  level  ) 

Manually changes the current detail level, rather than automatically via view distance.

Parameters:
level Detail level to force.
Example:
%interiorObject.setDetailLevel(2);

Member Data Documentation

Path and filename of the Interior file (.DIF) to load for this InteriorInstance.

ID of group the zone is part of.



Copyright © GarageGames, LLC. All Rights Reserved.