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