Structures/CollisionData

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m (Moved to structure template)
(Added description)
Line 2: Line 2:
 
| Description = Passed as argument of the [[SEnts/Events/PhysicsCollide|PhysicsCollide]] event.
 
| Description = Passed as argument of the [[SEnts/Events/PhysicsCollide|PhysicsCollide]] event.
 
| Fields =
 
| Fields =
{{StructureField|Shared|Vector|CollisionData|HitPos}}
+
{{StructureField|Shared|Vector|CollisionData|HitPos|The collisions position}}
{{StructureField|Shared|Entity|CollisionData|HitEntity}}
+
{{StructureField|Shared|Entity|CollisionData|HitEntity|The other collision entities}}
{{StructureField|Shared|Vector|CollisionData|OurOldVelocity}}
+
{{StructureField|Shared|Vector|CollisionData|OurOldVelocity|The entities velocity before the collision}}
{{StructureField|Shared|Physobj|CollisionData|HitObject}}
+
{{StructureField|Shared|PhysObj|CollisionData|HitObject|The physics that collided}}
{{StructureField|Shared|number|CollisionData|DeltaTime}}
+
{{StructureField|Shared|number|CollisionData|DeltaTime|Time since the last collision}}
{{StructureField|Shared|Vector|CollisionData|TheirOldVelocity}}
+
{{StructureField|Shared|Vector|CollisionData|TheirOldVelocity|Speed of the other entity before the collision}}
{{StructureField|Shared|number|CollisionData|Speed}}
+
{{StructureField|Shared|number|CollisionData|Speed|The absolute speed of the entity before the collision}}
{{StructureField|Shared|Vector|CollisionData|HitNormal}}
+
{{StructureField|Shared|Vector|CollisionData|HitNormal|Normal of the surface that hit the other entity}}
 
}}
 
}}

Revision as of 14:08, 3 August 2012

Passed as argument of the PhysicsCollide event.



Type Name Description
Shared Vector

CollisionData

Default: HitPos

Shared Entity

CollisionData

Default: HitEntity

Shared Vector

CollisionData

Default: OurOldVelocity

Shared PhysObj

CollisionData

Default: HitObject

Shared number

CollisionData

Default: DeltaTime

Shared Vector

CollisionData

Default: TheirOldVelocity

Shared number

CollisionData

Default: Speed

Shared Vector

CollisionData

Default: HitNormal

Personal tools
Navigation