1 //-----------------------------------------------------------------------------
2 // Copyright (c) 2012 GarageGames, LLC
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
21 //-----------------------------------------------------------------------------
23 #ifndef _OBJECTTYPES_H_
24 #define _OBJECTTYPES_H_
26 #include "platform/types.h"
28 /// Types used for SceneObject type masks (SceneObject::mTypeMask)
30 /// @note If a new object type is added, don't forget to add it to
31 /// RegisterGameFunctions().
34 /// @name Types used by the SceneObject class
37 /// Default value for type masks.
38 DefaultObjectType
= 0,
42 /// @name Basic Engine Types
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 ),
54 TerrainObjectType
= BIT( 2 ),
56 /// An object defining a water volume.
58 WaterObjectType
= BIT( 3 ),
60 /// An object defining an invisible trigger volume.
62 TriggerObjectType
= BIT( 4 ),
64 /// An object defining an invisible marker.
65 /// @see MissionMarker
66 MarkerObjectType
= BIT( 5 ),
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.
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.
83 /// Use this mask to find objects that are part of the static level geometry.
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.
91 /// Use this mask to find objects that are part of the dynamic game geometry.
92 DynamicShapeObjectType
= BIT( 9 ),
99 /// Any GameBase-derived object.
101 GameBaseObjectType
= BIT( 10 ),
103 /// An object that uses hifi networking.
104 GameBaseHiFiObjectType
= BIT( 11 ),
106 /// Any ShapeBase-derived object.
108 ShapeBaseObjectType
= BIT( 12 ),
112 CameraObjectType
= BIT( 13 ),
114 /// A human or AI player object.
116 PlayerObjectType
= BIT( 14 ),
120 ItemObjectType
= BIT( 15 ),
124 VehicleObjectType
= BIT( 16 ),
126 /// An object that blocks vehicles.
127 /// @see VehicleBlocker
128 VehicleBlockerObjectType
= BIT( 17 ),
130 /// A weapon projectile.
132 ProjectileObjectType
= BIT( 18 ),
134 /// An explosion object.
136 ExplosionObjectType
= BIT( 19 ),
138 /// A dead player. This is dynamically set and unset.
140 CorpseObjectType
= BIT( 20 ),
144 DebrisObjectType
= BIT( 21 ),
146 /// A volume that asserts forces on player objects.
147 /// @see PhysicalZone
148 PhysicalZoneObjectType
= BIT( 22 ),
150 EntityObjectType
= BIT(23),
154 enum SceneObjectTypeMasks
: U32
156 STATIC_COLLISION_TYPEMASK
= (StaticShapeObjectType
|
159 DAMAGEABLE_TYPEMASK
= ( PlayerObjectType
|
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
166 SHADOW_TYPEMASK
= ( StaticShapeObjectType
|
167 DynamicShapeObjectType
|
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
|
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
|
191 StaticShapeObjectType
|
192 DynamicShapeObjectType
|
193 LightObjectType
| // Flares.
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
)