objectTypes.h

Engine/source/T3D/objectTypes.h

More...

Public Enumerations

enum
SceneObjectTypeMasks {
  STATIC_COLLISION_TYPEMASK = (StaticShapeObjectType |
   EntityObjectType)
  DAMAGEABLE_TYPEMASK = (   PlayerObjectType        |
                              EntityObjectType |
                             VehicleObjectType )
  SHADOW_TYPEMASK = (  StaticShapeObjectType |
   DynamicShapeObjectType |
   EntityObjectType)
  CULLING_INCLUDE_TYPEMASK = (  GameBaseObjectType | 
                                 StaticShapeObjectType |
                                 DynamicShapeObjectType |
                                 EntityObjectType |
                                 ZoneObjectType |
                                 LightObjectType )
  CULLING_EXCLUDE_TYPEMASK = (  TerrainObjectType |
                                 EnvironmentObjectType )
  DEFAULT_RENDER_TYPEMASK = (   EnvironmentObjectType |
                                 TerrainObjectType |
                                 WaterObjectType |
                                 StaticShapeObjectType |
                                 DynamicShapeObjectType |
                                 LightObjectType | 
                                 GameBaseObjectType |
                                 TriggerObjectType | 
                                 EntityObjectType)
  EDITOR_RENDER_TYPEMASK = U32( -1 )
  OUTDOOR_OBJECT_TYPEMASK = (   TerrainObjectType |
                                 EnvironmentObjectType )
  SKYLIGHT_CAPTURE_TYPEMASK = (EnvironmentObjectType)
  REFLECTION_PROBE_CAPTURE_TYPEMASK = (StaticObjectType | StaticShapeObjectType)
}
enum
SceneObjectTypes {
  DefaultObjectType = 0
  StaticObjectType = BIT( 0 )
  EnvironmentObjectType = BIT( 1 )
  TerrainObjectType = BIT( 2 )
  WaterObjectType = BIT( 3 )
  TriggerObjectType = BIT( 4 )
  MarkerObjectType = BIT( 5 )
  LightObjectType = BIT( 6 )
  ZoneObjectType = BIT( 7 )
  StaticShapeObjectType = BIT( 8 )
  DynamicShapeObjectType = BIT( 9 )
  GameBaseObjectType = BIT( 10 )
  GameBaseHiFiObjectType = BIT( 11 )
  ShapeBaseObjectType = BIT( 12 )
  CameraObjectType = BIT( 13 )
  PlayerObjectType = BIT( 14 )
  ItemObjectType = BIT( 15 )
  VehicleObjectType = BIT( 16 )
  VehicleBlockerObjectType = BIT( 17 )
  ProjectileObjectType = BIT( 18 )
  ExplosionObjectType = BIT( 19 )
  CorpseObjectType = BIT( 20 )
  DebrisObjectType = BIT( 21 )
  PhysicalZoneObjectType = BIT( 22 )
  EntityObjectType = BIT(23)
  InteriorLikeObjectType =  BIT(24)
  TerrainLikeObjectType = BIT(25)
  PathShapeObjectType = BIT( 28 )
}

Types used for SceneObject type masks (SceneObject::mTypeMask)

Detailed Description

Public Enumerations

SceneObjectTypeMasks

Enumerator

STATIC_COLLISION_TYPEMASK = (StaticShapeObjectType | EntityObjectType)
DAMAGEABLE_TYPEMASK = ( PlayerObjectType | EntityObjectType | VehicleObjectType )
SHADOW_TYPEMASK = ( StaticShapeObjectType | DynamicShapeObjectType | EntityObjectType)

Typemask for objects that should be rendered into shadow passes.

These should be all objects that are either meant to receive or cast shadows or both.

CULLING_INCLUDE_TYPEMASK = ( GameBaseObjectType | StaticShapeObjectType | DynamicShapeObjectType | EntityObjectType | ZoneObjectType | LightObjectType )

Typemask for objects that should be subjected to more fine-grained culling tests.

Anything that is trivial rendering stuff or doesn't render except when in the editor should be excluded here.

Also, objects that do their own culling internally (terrains, forests, etc.) should be excluded.

CULLING_EXCLUDE_TYPEMASK = ( TerrainObjectType | EnvironmentObjectType )

Mask for objects that should be specifically excluded from zone culling.

DEFAULT_RENDER_TYPEMASK = ( EnvironmentObjectType | TerrainObjectType | WaterObjectType | StaticShapeObjectType | DynamicShapeObjectType | LightObjectType | GameBaseObjectType | TriggerObjectType | EntityObjectType)

Default object type mask to use for render queries.

EDITOR_RENDER_TYPEMASK = U32( -1 )

Typemask to use for rendering when inside the editor.

OUTDOOR_OBJECT_TYPEMASK = ( TerrainObjectType | EnvironmentObjectType )

All objects that fit this type mask will be exclusively assigned to the outdoor (root) zone and not be assigned to individual interior objects.

note:

Terrains have their own means for rendering inside interior zones.

SKYLIGHT_CAPTURE_TYPEMASK = (EnvironmentObjectType)
REFLECTION_PROBE_CAPTURE_TYPEMASK = (StaticObjectType | StaticShapeObjectType)
SceneObjectTypes

Enumerator

DefaultObjectType = 0

Default value for type masks.

StaticObjectType = BIT( 0 )

Any kind of SceneObject that is not supposed to change transforms except during editing (or not at all).

EnvironmentObjectType = BIT( 1 )

Environment objects such as clouds, skies, forests, etc.

TerrainObjectType = BIT( 2 )

A terrain object.

WaterObjectType = BIT( 3 )

An object defining a water volume.

TriggerObjectType = BIT( 4 )

An object defining an invisible trigger volume.

MarkerObjectType = BIT( 5 )

An object defining an invisible marker.

LightObjectType = BIT( 6 )

A light emitter.

ZoneObjectType = BIT( 7 )

An object that manages zones.

This is automatically set by SceneZoneSpaceManager when a SceneZoneSpace registers zones. Should not be manually set.

StaticShapeObjectType = BIT( 8 )

Any object that defines one or more solid, renderable static geometries that should be included in collision and raycasts.

Use this mask to find objects that are part of the static level geometry.

note:

If you set this, you will also want to set StaticObjectType.

DynamicShapeObjectType = BIT( 9 )

Any object that defines one or more solid, renderable dynamic geometries that should be included in collision and raycasts.

Use this mask to find objects that are part of the dynamic game geometry.

GameBaseObjectType = BIT( 10 )

Any GameBase-derived object.

GameBaseHiFiObjectType = BIT( 11 )

An object that uses hifi networking.

ShapeBaseObjectType = BIT( 12 )

Any ShapeBase-derived object.

CameraObjectType = BIT( 13 )

A camera object.

see:

PlayerObjectType = BIT( 14 )

A human or AI player object.

see:

ItemObjectType = BIT( 15 )

An item pickup.

see:

VehicleObjectType = BIT( 16 )

A vehicle.

VehicleBlockerObjectType = BIT( 17 )

An object that blocks vehicles.

ProjectileObjectType = BIT( 18 )

A weapon projectile.

ExplosionObjectType = BIT( 19 )

An explosion object.

CorpseObjectType = BIT( 20 )

A dead player.

This is dynamically set and unset.

see:

DebrisObjectType = BIT( 21 )

A debris object.

see:

PhysicalZoneObjectType = BIT( 22 )

A volume that asserts forces on player objects.

EntityObjectType = BIT(23)
InteriorLikeObjectType = BIT(24)
TerrainLikeObjectType = BIT(25)
PathShapeObjectType = BIT( 28 )

Types used for SceneObject type masks (SceneObject::mTypeMask)

note:

If a new object type is added, don't forget to add it to RegisterGameFunctions().

  1
  2//-----------------------------------------------------------------------------
  3// Copyright (c) 2012 GarageGames, LLC
  4//
  5// Permission is hereby granted, free of charge, to any person obtaining a copy
  6// of this software and associated documentation files (the "Software"), to
  7// deal in the Software without restriction, including without limitation the
  8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  9// sell copies of the Software, and to permit persons to whom the Software is
 10// furnished to do so, subject to the following conditions:
 11//
 12// The above copyright notice and this permission notice shall be included in
 13// all copies or substantial portions of the Software.
 14//
 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 21// IN THE SOFTWARE.
 22//-----------------------------------------------------------------------------
 23
 24//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
 25// Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames
 26// Copyright (C) 2015 Faust Logic, Inc.
 27//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
 28
 29#ifndef _OBJECTTYPES_H_
 30#define _OBJECTTYPES_H_
 31
 32#include "platform/types.h"
 33
 34// Uncomment the AFX_CAP_AFXMODEL_TYPE define below to enable a type flag
 35// for afxModel objects.
 36//#define AFX_CAP_AFXMODEL_TYPE
 37/// Types used for SceneObject type masks (SceneObject::mTypeMask)
 38///
 39/// @note If a new object type is added, don't forget to add it to
 40///      RegisterGameFunctions().
 41enum SceneObjectTypes
 42{
 43   /// @name Types used by the SceneObject class
 44   /// @{
 45
 46   /// Default value for type masks.
 47   DefaultObjectType = 0,
 48
 49   /// @}
 50
 51   /// @name Basic Engine Types
 52   /// @{
 53
 54   /// Any kind of SceneObject that is not supposed to change transforms
 55   /// except during editing (or not at all).
 56   StaticObjectType = BIT( 0 ),
 57
 58   /// Environment objects such as clouds, skies, forests, etc.
 59   EnvironmentObjectType = BIT( 1 ),
 60
 61   /// A terrain object.
 62   /// @see TerrainBlock
 63   TerrainObjectType = BIT( 2 ),
 64
 65   /// An object defining a water volume.
 66   /// @see WaterObject
 67   WaterObjectType = BIT( 3 ),
 68
 69   /// An object defining an invisible trigger volume.
 70   /// @see Trigger
 71   TriggerObjectType = BIT( 4 ),
 72
 73   /// An object defining an invisible marker.
 74   /// @see MissionMarker
 75   MarkerObjectType = BIT( 5 ),
 76
 77   /// A light emitter.
 78   /// @see LightBase
 79   LightObjectType = BIT( 6 ),
 80
 81   /// An object that manages zones.  This is automatically set by
 82   /// SceneZoneSpaceManager when a SceneZoneSpace registers zones.  Should
 83   /// not be manually set.
 84   ///
 85   /// @see SceneZoneSpace
 86   /// @see SceneZoneSpaceManager
 87   ZoneObjectType = BIT( 7 ),
 88
 89   /// Any object that defines one or more solid, renderable static geometries that
 90   /// should be included in collision and raycasts.
 91   ///
 92   /// Use this mask to find objects that are part of the static level geometry.
 93   ///
 94   /// @note If you set this, you will also want to set StaticObjectType.
 95   StaticShapeObjectType = BIT( 8 ),
 96
 97   /// Any object that defines one or more solid, renderable dynamic geometries that
 98   /// should be included in collision and raycasts.
 99   ///
100   /// Use this mask to find objects that are part of the dynamic game geometry.
101   DynamicShapeObjectType = BIT( 9 ),
102
103   /// @}
104
105   /// @name Game Types
106   /// @{
107
108   /// Any GameBase-derived object.
109   /// @see GameBase
110   GameBaseObjectType = BIT( 10 ),
111
112   /// An object that uses hifi networking.
113   GameBaseHiFiObjectType = BIT( 11 ),
114
115   /// Any ShapeBase-derived object.
116   /// @see ShapeBase
117   ShapeBaseObjectType = BIT( 12 ),
118
119   /// A camera object.
120   /// @see Camera
121   CameraObjectType = BIT( 13 ),
122
123   /// A human or AI player object.
124   /// @see Player
125   PlayerObjectType = BIT( 14 ),
126
127   /// An item pickup.
128   /// @see Item
129   ItemObjectType = BIT( 15 ),
130
131   /// A vehicle.
132   /// @see Vehicle
133   VehicleObjectType = BIT( 16 ),
134
135   /// An object that blocks vehicles.
136   /// @see VehicleBlocker
137   VehicleBlockerObjectType = BIT( 17 ),
138
139   /// A weapon projectile.
140   /// @see Projectile
141   ProjectileObjectType = BIT( 18 ),
142
143   /// An explosion object.
144   /// @see Explosion
145   ExplosionObjectType = BIT( 19 ),
146
147   /// A dead player.  This is dynamically set and unset.
148   /// @see Player
149   CorpseObjectType = BIT( 20 ),
150
151   /// A debris object.
152   /// @see Debris
153   DebrisObjectType = BIT( 21 ),
154
155   /// A volume that asserts forces on player objects.
156   /// @see PhysicalZone
157   PhysicalZoneObjectType = BIT( 22 ),
158
159   EntityObjectType = BIT(23),
160   /// @}
161   InteriorLikeObjectType =  BIT(24),
162   TerrainLikeObjectType = BIT(25),
163#if defined(AFX_CAP_AFXMODEL_TYPE) 
164   afxModelObjectType = BIT(26)
165#endif 
166
167   // PATHSHAPE 
168   PathShapeObjectType = BIT( 28 ),
169   // PATHSHAPE END
170
171   /// @}
172};
173
174enum SceneObjectTypeMasks : U32
175{
176   STATIC_COLLISION_TYPEMASK = (StaticShapeObjectType |
177   EntityObjectType),
178
179   DAMAGEABLE_TYPEMASK = (   PlayerObjectType        |
180                              EntityObjectType |
181                             VehicleObjectType ),
182
183   /// Typemask for objects that should be rendered into shadow passes.
184   /// These should be all objects that are either meant to receive or cast
185   /// shadows or both.
186   SHADOW_TYPEMASK = (  StaticShapeObjectType |
187   DynamicShapeObjectType |
188   EntityObjectType),
189
190   /// Typemask for objects that should be subjected to more fine-grained
191   /// culling tests.  Anything that is trivial rendering stuff or doesn't
192   /// render except when in the editor should be excluded here.
193   ///
194   /// Also, objects that do their own culling internally (terrains, forests, etc.)
195   /// should be excluded.
196   CULLING_INCLUDE_TYPEMASK = (  GameBaseObjectType | // Includes most other renderable types; but broader than we ideally want.
197                                 StaticShapeObjectType |
198                                 DynamicShapeObjectType |
199                                 EntityObjectType |
200                                 ZoneObjectType |
201                                 LightObjectType ), // This improves the result of zone traversals.
202
203   /// Mask for objects that should be specifically excluded from zone culling.
204   CULLING_EXCLUDE_TYPEMASK = (  TerrainObjectType |
205                                 EnvironmentObjectType ),
206
207   /// Default object type mask to use for render queries.
208   DEFAULT_RENDER_TYPEMASK = (   EnvironmentObjectType |
209                                 TerrainObjectType |
210                                 WaterObjectType |
211                                 StaticShapeObjectType |
212                                 DynamicShapeObjectType |
213                                 LightObjectType | // Flares.
214                                 GameBaseObjectType |
215                                 TriggerObjectType | 
216                                 EntityObjectType),
217
218   /// Typemask to use for rendering when inside the editor.
219   EDITOR_RENDER_TYPEMASK = U32( -1 ),
220
221   /// All objects that fit this type mask will be exclusively assigned to the outdoor (root)
222   /// zone and not be assigned to individual interior objects.
223   ///
224   /// @note Terrains have their own means for rendering inside interior zones.
225   OUTDOOR_OBJECT_TYPEMASK = (   TerrainObjectType |
226                                 EnvironmentObjectType ),
227
228   SKYLIGHT_CAPTURE_TYPEMASK = (EnvironmentObjectType),
229   REFLECTION_PROBE_CAPTURE_TYPEMASK = (StaticObjectType | StaticShapeObjectType)
230};
231
232#endif
233