Box2D Joint Toy
Ian Parberry's "Introduction to Game Physics"
Functions | Variables
NautilusGear.cpp File Reference

Code for the nautilus gear class CNautilusGear. More...

#include "NautilusGear.h"
#include "ComponentIncludes.h"
#include <algorithm>
#include "GameDefines.h"
#include "ObjectManager.h"
#include "Renderer.h"

Functions

void NormalizeAngle (float &theta)
 Normalize an angle. Force an angle in radians to be between 0 and 2*PI. More...
 
void b2SetAngle (b2Body *p, const float a)
 Set the orientation of a b2Body. Set the angle of a b2Body using the SetTransform function, because b2Body apparently no longer has a SetAngle function. More...
 

Variables

static const int CENTER = 0
 Index of center gear.
 
static const int RIGHT = 1
 Index of right gear.
 
static const int UP = 2
 Index of up gear.
 
static const int LEFT = 3
 Index of left gear.
 
static const int DOWN = 4
 Index of down gear.
 

Detailed Description

Code for the nautilus gear class CNautilusGear.

Function Documentation

◆ b2SetAngle()

void b2SetAngle ( b2Body *  p,
const float  a 
)

Set the orientation of a b2Body. Set the angle of a b2Body using the SetTransform function, because b2Body apparently no longer has a SetAngle function.

Parameters
pPointer to a b2Body.
aAn angle in radians.

◆ NormalizeAngle()

void NormalizeAngle ( float &  theta)

Normalize an angle. Force an angle in radians to be between 0 and 2*PI.

Parameters
theta[IN, OUT] Angle to be normalized.