Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
SoftBodyVertex.h
Go to the documentation of this file.
1// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2// SPDX-FileCopyrightText: 2023 Jorrit Rouwe
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
8
10
16{
17public:
19 inline void ResetCollision()
20 {
21 mLargestPenetration = -FLT_MAX;
23 mHasContact = false;
24 }
25
27 inline void MarkCCDContact(const BodyID &inBodyID, const Plane &inContactPlane)
28 {
29 mCollisionPlane = inContactPlane;
30 mCollidingShapeIndex = int(inBodyID.GetIndexAndSequenceNumber() | BodyID::cBroadPhaseBit); // We reuse the broad phase bit to indicate this is a CCD contact
31 mHasContact = true;
32 }
33
41 float mInvMass;
42};
43
#define JPH_NAMESPACE_END
Definition Core.h:428
#define JPH_NAMESPACE_BEGIN
Definition Core.h:422
ID of a body. This is a way of reasoning about bodies in a multithreaded simulation while avoiding ra...
Definition BodyID.h:13
static constexpr uint32 cBroadPhaseBit
This bit is used by the broadphase.
Definition BodyID.h:18
uint32 GetIndexAndSequenceNumber() const
Returns the index and sequence number combined in an uint32.
Definition BodyID.h:59
An infinite plane described by the formula X . Normal + Constant = 0.
Definition Plane.h:11
Definition SoftBodyVertex.h:16
void ResetCollision()
Reset collision information to prepare for a new collision check.
Definition SoftBodyVertex.h:19
Vec3 mPreviousPosition
Internal use only. Position at the previous time step.
Definition SoftBodyVertex.h:34
float mInvMass
Inverse mass (1 / mass)
Definition SoftBodyVertex.h:41
void MarkCCDContact(const BodyID &inBodyID, const Plane &inContactPlane)
Mark this vertex as being in contact with inBodyID.
Definition SoftBodyVertex.h:27
Vec3 mVelocity
Velocity, relative to the center of mass of the soft body.
Definition SoftBodyVertex.h:36
bool mHasContact
True if the vertex has collided with anything in the last update.
Definition SoftBodyVertex.h:39
float mLargestPenetration
Internal use only. Used while finding the collision plane, stores the largest penetration found so fa...
Definition SoftBodyVertex.h:40
int mCollidingShapeIndex
Internal use only. Index in the colliding shapes list of the body we may collide with.
Definition SoftBodyVertex.h:38
Plane mCollisionPlane
Internal use only. Nearest collision plane, relative to the center of mass of the soft body.
Definition SoftBodyVertex.h:37
Vec3 mPosition
Position, relative to the center of mass of the soft body.
Definition SoftBodyVertex.h:35
Definition Vec3.h:17