//========= Copyright © Valve Corporation, All rights reserved. ============// #ifndef RUBIKON_INTERSECTION_ATTRIBUTES_HDR #define RUBIKON_INTERSECTION_ATTRIBUTES_HDR static const uint32 INTERSECTION_ENTITY_ID_NONE = 0xFFFFFFFF; enum BuiltInCollisionGroup_t { // Default layer, always collides with everything. COLLISION_GROUP_ALWAYS = 0, // "always" // This is how you turn off all collisions for an object - move it to this group COLLISION_GROUP_NONPHYSICAL = 1, // "never" // Trigger layer, never collides with anything, only triggers/interacts. Use when querying for interaction layers. COLLISION_GROUP_TRIGGER = 2, // "trigger" // Conditionally solid means that the collision response will be zero or as defined in the table when there are matching interactions COLLISION_GROUP_CONDITIONALLY_SOLID = 3, // needs interactions // First unreserved collision layer index. COLLISION_GROUP_FIRST_USER = 4, // Hard limit of 254 due to memory layout, and these are never visible to scene queries. COLLISION_GROUPS_MAX_ALLOWED = 64, }; enum BuiltInInteractionLayer_t { // Slow path for generating interactions when INTERSECTION_INTERACTION_LAYER_MAX is hit. // Set by default on every m_interactsAs, but not any m_interactsWith. INTERACTION_LAYER_ALWAYS = 0, // "always" // Indicates that the query will have to recurse into a hitbox model. INTERACTION_LAYER_HITBOXES = 1, // Might as well hard-code "trigger" as generic interaction layer. Character Controllers add it by default. INTERACTION_LAYER_TRIGGER = 2, // First unreserved interaction layer index. INTERACTION_LAYER_SKY = 3, INTERACTION_LAYER_FIRST_USER = 4, INTERACTION_LAYER_NOT_FOUND = -1, // Number of scene query interaction layers limited by storing these in a 64-bit uint mask INTERACTION_LAYERS_MAX_ALLOWED = 64, }; enum IntersectionPairFlags_t { INTERSECTION_PAIR_RESOLVE_CONTACTS = (1<<0), INTERSECTION_PAIR_NOTIFY_TOUCH_FOUND = (1<<2), INTERSECTION_PAIR_NOTIFY_TOUCH_PERSISTS = (1<<3), INTERSECTION_PAIR_NOTIFY_TOUCH_LOST = (1<<4), INTERSECTION_PAIR_TRIGGER = INTERSECTION_PAIR_NOTIFY_TOUCH_FOUND | INTERSECTION_PAIR_NOTIFY_TOUCH_LOST, INTERSECTION_PAIR_DEFAULT_COLLISION = INTERSECTION_PAIR_RESOLVE_CONTACTS, INTERSECTION_NOTIFICATION_ANY = INTERSECTION_PAIR_NOTIFY_TOUCH_FOUND | INTERSECTION_PAIR_NOTIFY_TOUCH_PERSISTS | INTERSECTION_PAIR_NOTIFY_TOUCH_LOST }; enum IntersectionQueryResult_t { INTERSECTION_QUERY_RESULT_FLAGS_NONE = 0, INTERSECTION_QUERY_RESULT_FLAGS_BLOCK = 1, }; enum CollisionFunctionMask_t { FCOLLISION_FUNC_ENABLE_SOLID_CONTACT = 1<<0, FCOLLISION_FUNC_ENABLE_TRACE_QUERY = 1<<1, FCOLLISION_FUNC_ENABLE_TOUCH_EVENT = 1<<2, FCOLLISION_FUNC_ENABLE_SHOULD_COLLIDE_CALLBACK = 1<<3, FCOLLISION_FUNC_IGNORE_FOR_HITBOX_TEST = 1<<4, }; enum RnMassPriorityEnum_t { MASS_PRIORITY_DEFAULT = 0, MASS_PRIORITY_TRIGGER = -1 // triggers never have mass that affects other physics objects }; // Volume queries: Let's you decide between broadphase proxy and shape overlaps enum OverlapTest_t { OVERLAP_TEST_PROXY, // This will only test the shapes broadphase proxy and not the shape itself OVERLAP_TEST_SHAPE // This will first find all overlapping proxies inside the broadphase and then test the actual shape for overlap }; // these are on by default #define FCOLLISION_FUNC_DEFAULT (FCOLLISION_FUNC_ENABLE_SOLID_CONTACT | FCOLLISION_FUNC_ENABLE_TRACE_QUERY | FCOLLISION_FUNC_ENABLE_TOUCH_EVENT) extern CUtlString IntersectionPairFlagsToString( uint16 nPairFlags ); // TODO: Currently these flags are stored in a table as 16-bits per-pair. Once we have // TODO: identified the desired permutations of flags, the per-pair data will be // TODO: palletized down to a 4-bit index into a lookup table. // ================================================================================================== typedef int32 IntersectionLayerIndex; typedef int32 CollisionGroupIndex; typedef uint16 IntersectionLayerPairFlags; typedef uint16 CollisionGroupPairFlags; struct RnCollisionAttr_t { public: //uintp m_nOwner; // Which interaction layers do I represent? (e.g. I am a INTERACTION_LAYER_PLAYERCLIP volume) // NOTE: This is analogous to "contents" in source 1 (bit mask of CONTENTS_* or 1<