Bullet Collision Detection & Physics Library
btWheelInfo.cpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2005 Erwin Coumans https://bulletphysics.org
3 *
4 * Permission to use, copy, modify, distribute and sell this software
5 * and its documentation for any purpose is hereby granted without fee,
6 * provided that the above copyright notice appear in all copies.
7 * Erwin Coumans makes no representations about the suitability
8 * of this software for any purpose.
9 * It is provided "as is" without express or implied warranty.
10*/
11#include "btWheelInfo.h"
12#include "BulletDynamics/Dynamics/btRigidBody.h" // for pointvelocity
13
15{
17}
18
20{
22
24
25 {
28 btVector3 relpos = m_raycastInfo.m_contactPointWS - chassis.getCenterOfMassPosition();
29 chassis_velocity_at_contactPoint = chassis.getVelocityInLocalPoint(relpos);
31 if (project >= btScalar(-0.1))
32 {
35 }
36 else
37 {
38 btScalar inv = btScalar(-1.) / project;
41 }
42 }
43
44 else // Not in contact : position wheel in a nice (rest length) position
45 {
50 }
51}
const T & btMax(const T &a, const T &b)
Definition btMinMax.h:27
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition btScalar.h:314
The btRigidBody is the main class for rigid body objects.
Definition btRigidBody.h:60
btVector3 can be used to represent 3D points and vectors.
Definition btVector3.h:82
btScalar dot(const btVector3 &v) const
Return the dot product.
Definition btVector3.h:229
btScalar m_clippedInvContactDotSuspension
void updateWheel(const btRigidBody &chassis, RaycastInfo &raycastInfo)
btScalar getSuspensionRestLength() const
btScalar m_suspensionRestLength1
Definition btWheelInfo.h:59
btScalar m_suspensionRelativeVelocity
RaycastInfo m_raycastInfo
Definition btWheelInfo.h:52