|
Object used to represent buildings and other architectural structures (legacy). More...
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. |
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.
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.
mapTo | The name of the material target to remap (from getTargetName) | |
oldMat | The old Material that was mapped | |
newMat | The new Material to map |
// 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.
bakeTransform | Bakes the InteriorInstance's transform into the vertex positions |
// Export to COLLADA, do not bakeTransform
%interiorObject.exportToCollada(0);
string InteriorInstance::getModelFile | ( | ) |
Get the interior file name.
%interiorObject.getModelFile();
int InteriorInstance::getNumDetailLevels | ( | ) |
Get the number of detail levels interior was created with.
%numLODs = %interiorObject.getNumDetailLevels(); echo(%numLODs);
int InteriorInstance::getTargetCount | ( | int | detailLevel | ) |
Get the number of materials used by interior.
detailLevel | Interior level of detail to scan |
// 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.
detailLevel | Target LOD | |
targetNum | Index mapped to the target |
// 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.
alarmMode | If true the interior will be in an alarm state next frame. Options are 'On' or 'Off'. |
// 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.
level | Detail level to force. |
%interiorObject.setDetailLevel(2);
filename InteriorInstance::interiorFile |
Path and filename of the Interior file (.DIF) to load for this InteriorInstance.
bool InteriorInstance::isRenderable [static] |
Disables rendering of all instances of this type.
Reimplemented from SceneObject.
bool InteriorInstance::isSelectable [static] |
Disables selection of all instances of this type.
Reimplemented from SceneObject.
ID of group the zone is part of.