Public Member Functions | Protected Attributes | Friends | List of all members
Test Class Reference

#include <test.h>

Inherits b2ContactListener.

Inherited by AddPair, ApplyForce, BodyTypes, BoxStack, Breakable, Bridge, BulletTest, Cantilever, Car, Chain, ChainProblem, CharacterCollision, CircleStack, CollisionFiltering, CollisionProcessing, CompoundShapes, Confined, ContinuousTest, ConvexHull, ConveyorBelt, DistanceJoint, DistanceTest, Dominos, DumpLoader, DynamicTree, EdgeShapes, EdgeTest, Friction, GearJoint, Heavy1, Heavy2, MobileBalanced, MobileUnbalanced, MotorJoint, Pinball, Platformer, PolygonCollision, PolygonShapes, PrismaticJoint, PulleyJoint, Pyramid, RayCast, Restitution, RevoluteJoint, Rope, Sensors, ShapeCast, ShapeEditing, Skier, SliderCrank1, SliderCrank2, TheoJansen, Tiles, TimeOfImpact, Tumbler, Web, WheelJoint, and WreckingBall.

Public Member Functions

virtual void BeginContact (b2Contact *contact) override
 Called when two fixtures begin to touch. More...
 
void CompleteBombSpawn (const b2Vec2 &p)
 
void DrawTitle (const char *string)
 
virtual void EndContact (b2Contact *contact) override
 Called when two fixtures cease to touch. More...
 
virtual void JointDestroyed (b2Joint *joint)
 
virtual void Keyboard (int key)
 
virtual void KeyboardUp (int key)
 
void LaunchBomb ()
 
void LaunchBomb (const b2Vec2 &position, const b2Vec2 &velocity)
 
virtual void MouseDown (const b2Vec2 &p)
 
virtual void MouseMove (const b2Vec2 &p)
 
virtual void MouseUp (const b2Vec2 &p)
 
virtual void PostSolve (b2Contact *contact, const b2ContactImpulse *impulse) override
 
virtual void PreSolve (b2Contact *contact, const b2Manifold *oldManifold) override
 
void ShiftMouseDown (const b2Vec2 &p)
 
void ShiftOrigin (const b2Vec2 &newOrigin)
 
void SpawnBomb (const b2Vec2 &worldPt)
 
virtual void Step (Settings &settings)
 
 Test ()
 
virtual void UpdateUI ()
 
virtual ~Test ()
 
- Public Member Functions inherited from b2ContactListener
virtual ~b2ContactListener ()
 

Protected Attributes

b2Bodym_bomb
 
bool m_bombSpawning
 
b2Vec2 m_bombSpawnPoint
 
DestructionListener m_destructionListener
 
b2Bodym_groundBody
 
b2Profile m_maxProfile
 
b2MouseJointm_mouseJoint
 
b2Vec2 m_mouseWorld
 
int32 m_pointCount
 
ContactPoint m_points [k_maxContactPoints]
 
int32 m_stepCount
 
int32 m_textIncrement
 
int32 m_textLine
 
b2Profile m_totalProfile
 
b2Worldm_world
 
b2AABB m_worldAABB
 

Friends

class BoundaryListener
 
class ContactListener
 
class DestructionListener
 

Detailed Description

Definition at line 80 of file test.h.

Constructor & Destructor Documentation

◆ Test()

Test::Test ( )

Definition at line 39 of file test.cpp.

◆ ~Test()

Test::~Test ( )
virtual

Definition at line 66 of file test.cpp.

Member Function Documentation

◆ BeginContact()

virtual void Test::BeginContact ( b2Contact contact)
inlineoverridevirtual

Called when two fixtures begin to touch.

Reimplemented from b2ContactListener.

Reimplemented in Sensors.

Definition at line 106 of file test.h.

◆ CompleteBombSpawn()

void Test::CompleteBombSpawn ( const b2Vec2 p)

Definition at line 188 of file test.cpp.

◆ DrawTitle()

void Test::DrawTitle ( const char *  string)

Definition at line 106 of file test.cpp.

◆ EndContact()

virtual void Test::EndContact ( b2Contact contact)
inlineoverridevirtual

Called when two fixtures cease to touch.

Reimplemented from b2ContactListener.

Reimplemented in Sensors.

Definition at line 107 of file test.h.

◆ JointDestroyed()

virtual void Test::JointDestroyed ( b2Joint joint)
inlinevirtual

Reimplemented in Web.

Definition at line 103 of file test.h.

◆ Keyboard()

virtual void Test::Keyboard ( int  key)
inlinevirtual

◆ KeyboardUp()

virtual void Test::KeyboardUp ( int  key)
inlinevirtual

Reimplemented in Pinball.

Definition at line 91 of file test.h.

◆ LaunchBomb() [1/2]

void Test::LaunchBomb ( )

Definition at line 238 of file test.cpp.

◆ LaunchBomb() [2/2]

void Test::LaunchBomb ( const b2Vec2 position,
const b2Vec2 velocity 
)

Definition at line 245 of file test.cpp.

◆ MouseDown()

void Test::MouseDown ( const b2Vec2 p)
virtual

Definition at line 144 of file test.cpp.

◆ MouseMove()

void Test::MouseMove ( const b2Vec2 p)
virtual

Definition at line 228 of file test.cpp.

◆ MouseUp()

void Test::MouseUp ( const b2Vec2 p)
virtual

Definition at line 214 of file test.cpp.

◆ PostSolve()

virtual void Test::PostSolve ( b2Contact contact,
const b2ContactImpulse impulse 
)
inlineoverridevirtual

This lets you inspect a contact after the solver is finished. This is useful for inspecting impulses. Note: the contact manifold does not include time of impact impulses, which can be arbitrarily large if the sub-step is small. Hence the impulse is provided explicitly in a separate data structure. Note: this is only called for contacts that are touching, solid, and awake.

Reimplemented from b2ContactListener.

Reimplemented in Breakable.

Definition at line 109 of file test.h.

◆ PreSolve()

void Test::PreSolve ( b2Contact contact,
const b2Manifold oldManifold 
)
overridevirtual

This is called after a contact is updated. This allows you to inspect a contact before it goes to the solver. If you are careful, you can modify the contact manifold (e.g. disable contact). A copy of the old manifold is provided so that you can detect changes. Note: this is called only for awake bodies. Note: this is called even when the number of contact points is zero. Note: this is not called for sensors. Note: if you set the number of contact points to zero, you will not get an EndContact callback. However, you may get a BeginContact callback the next step.

Reimplemented from b2ContactListener.

Reimplemented in Platformer, and ConveyorBelt.

Definition at line 73 of file test.cpp.

◆ ShiftMouseDown()

void Test::ShiftMouseDown ( const b2Vec2 p)

Definition at line 202 of file test.cpp.

◆ ShiftOrigin()

void Test::ShiftOrigin ( const b2Vec2 newOrigin)

Definition at line 450 of file test.cpp.

◆ SpawnBomb()

void Test::SpawnBomb ( const b2Vec2 worldPt)

Definition at line 182 of file test.cpp.

◆ Step()

void Test::Step ( Settings settings)
virtual

◆ UpdateUI()

virtual void Test::UpdateUI ( )
inlinevirtual

Friends And Related Function Documentation

◆ BoundaryListener

friend class BoundaryListener
friend

Definition at line 119 of file test.h.

◆ ContactListener

friend class ContactListener
friend

Definition at line 120 of file test.h.

◆ DestructionListener

friend class DestructionListener
friend

Definition at line 118 of file test.h.

Member Data Documentation

◆ m_bomb

b2Body* Test::m_bomb
protected

Definition at line 129 of file test.h.

◆ m_bombSpawning

bool Test::m_bombSpawning
protected

Definition at line 132 of file test.h.

◆ m_bombSpawnPoint

b2Vec2 Test::m_bombSpawnPoint
protected

Definition at line 131 of file test.h.

◆ m_destructionListener

DestructionListener Test::m_destructionListener
protected

Definition at line 126 of file test.h.

◆ m_groundBody

b2Body* Test::m_groundBody
protected

Definition at line 122 of file test.h.

◆ m_maxProfile

b2Profile Test::m_maxProfile
protected

Definition at line 136 of file test.h.

◆ m_mouseJoint

b2MouseJoint* Test::m_mouseJoint
protected

Definition at line 130 of file test.h.

◆ m_mouseWorld

b2Vec2 Test::m_mouseWorld
protected

Definition at line 133 of file test.h.

◆ m_pointCount

int32 Test::m_pointCount
protected

Definition at line 125 of file test.h.

◆ m_points

ContactPoint Test::m_points[k_maxContactPoints]
protected

Definition at line 124 of file test.h.

◆ m_stepCount

int32 Test::m_stepCount
protected

Definition at line 134 of file test.h.

◆ m_textIncrement

int32 Test::m_textIncrement
protected

Definition at line 135 of file test.h.

◆ m_textLine

int32 Test::m_textLine
protected

Definition at line 127 of file test.h.

◆ m_totalProfile

b2Profile Test::m_totalProfile
protected

Definition at line 137 of file test.h.

◆ m_world

b2World* Test::m_world
protected

Definition at line 128 of file test.h.

◆ m_worldAABB

b2AABB Test::m_worldAABB
protected

Definition at line 123 of file test.h.


The documentation for this class was generated from the following files:


mvsim
Author(s):
autogenerated on Tue Jul 4 2023 03:08:23