Garry's Mod Wiki

Revision Difference

Structures/CollisionData#516812

<cat>struct</cat> <structure>⤶ <description>⤶ Passed as argument of <page>ENTITY:PhysicsCollide</page>.⤶ {{Structure⤶ |Description=Passed as argument of <page>ENTITY:PhysicsCollide</page>.⤶ <note>Sometimes, the value of 'Speed' can be different from getting the length calculated from 'OurOldVelocity', even though they should be the same, or close to same. It's recommended to do 'OurOldVelocity:Length()' instead. ``` ENT:PhysicsCollide( colData, collider ) -- you may get two completely different values, and the second one should be more accurate. print(colData.Speed) print(colData.OurOldVelocity:Length()) end ``` </note> </description>⤶ <fields>{{StructureField|Vector|HitPos|The collision position</fields>⤶ ⤶ </structure>⤶ ⤶ {{StructureField|Entity|HitEntity|The other collision entity}}{{StructureField|Vector|OurOldVelocity|The entity's velocity before the collision}}{{StructureField|PhysObj|HitObject|Other entity's physics object}}{{StructureField|number|DeltaTime|Time since the last collision `with this HitEntity`}}{{StructureField|Vector|TheirOldVelocity|Speed of the other entity before the collision}}{{StructureField|number|Speed|The speed of the entity before the collision}}{{StructureField|Vector|HitNormal|Normal of the surface that hit the other entity}}{{StructureField|PhysObj|PhysObject|Entity's physics object}}⤶ ⤶ |Fields={{StructureField|Vector|HitPos|The collision position}}{{StructureField|Entity|HitEntity|The other collision entity}}{{StructureField|Vector|OurOldVelocity|The entity's velocity before the collision}}{{StructureField|PhysObj|HitObject|Other entity's physics object}}{{StructureField|number|DeltaTime|Time since the last collision `with this HitEntity`}}{{StructureField|Vector|TheirOldVelocity|Speed of the other entity before the collision}}{{StructureField|number|Speed|The speed of the entity before the collision}}{{StructureField|Vector|HitNormal|Normal of the surface that hit the other entity}}{{StructureField|PhysObj|PhysObject|Entity's physics object}}⤶ }}