vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
Vkm::Engine::Contact Struct Reference

A single collision contact point in world space. More...

#include <contact.h>

Public Attributes

glm::vec3 point = {0.0f, 0.0f, 0.0f}
 Contact position (world)
glm::vec3 normal = {0.0f, 1.0f, 0.0f}
 Unit normal, A -> B.
float penetration = 0.0f
 Positive overlap depth.
float normalImpulse = 0.0f
 Accumulated normal impulse, seeded from last tick.
float restitutionBias = 0.0f
 Target separation speed (set once, pre-solve)
glm::vec3 tangent1 = {0.0f, 0.0f, 0.0f}
 Friction as two impulses along a basis fixed for the whole tick.
glm::vec3 warmFriction = {0.0f, 0.0f, 0.0f}
 Last tick's friction, as a world vector, waiting for a basis.
glm::vec3 rA = {0.0f, 0.0f, 0.0f}
 Pre-solve constants: the lever arms and the effective masses.

Detailed Description

A single collision contact point in world space.

The accumulated impulses persist across solver passes, so they converge, and across ticks, seeded by ContactCache::seed before the solve.

Member Data Documentation

◆ tangent1

glm::vec3 Vkm::Engine::Contact::tangent1 = {0.0f, 0.0f, 0.0f}

Friction as two impulses along a basis fixed for the whole tick.

Not one impulse along the sliding direction: that is re-derived every pass, so a pass that finds the sliding reversed would apply the whole accumulated scalar the wrong way.

◆ warmFriction

glm::vec3 Vkm::Engine::Contact::warmFriction = {0.0f, 0.0f, 0.0f}

Last tick's friction, as a world vector, waiting for a basis.

Left by ContactCache::seed; the pre-solve resolves it into tangentImpulse1/2 once the basis exists. Zero when the cache had nothing. A vector, because the scalars mean something only on the basis they were measured on, and seed runs before this tick's basis is built.

◆ rA

glm::vec3 Vkm::Engine::Contact::rA = {0.0f, 0.0f, 0.0f}

Pre-solve constants: the lever arms and the effective masses.

No pass moves a body (poses integrate once, between the biased and relax passes), so these are built once and read unchanged by every pass.


The documentation for this struct was generated from the following file: