24 Sphere( StkFloat radius = 1.0 ) { radius_ = radius; mass_ = 1.0; };
33 void setRadius( StkFloat radius ) { radius_ = radius; };
36 void setMass( StkFloat mass ) { mass_ = mass; };
54 StkFloat
getMass(
void ) {
return mass_; };
60 void tick( StkFloat timeIncrement );
72 position_.
setX(position_.
getX() + (timeIncrement * velocity_.
getX()));
73 position_.
setY(position_.
getY() + (timeIncrement * velocity_.
getY()));
74 position_.
setZ(position_.
getZ() + (timeIncrement * velocity_.
getZ()));
STK sphere class.
Definition: Sphere.h:21
StkFloat isInside(Vector3D *position)
Returns the distance from the sphere boundary to the given position (< 0 if inside).
StkFloat getRadius(void)
Get the current sphere radius.
Definition: Sphere.h:51
void setMass(StkFloat mass)
Set the mass of the sphere.
Definition: Sphere.h:36
void addVelocity(StkFloat x, StkFloat y, StkFloat z)
Increase the current sphere velocity by the given 3D components.
StkFloat getVelocity(Vector3D *velocity)
Set the velocity of the sphere as a 3D vector.
Vector3D * getRelativePosition(Vector3D *position)
Get the relative position of the given point to the sphere as a 3D vector.
Sphere(StkFloat radius=1.0)
Constructor taking an initial radius value.
Definition: Sphere.h:24
Vector3D * getPosition(void)
Get the current position of the sphere as a 3D vector.
Definition: Sphere.h:39
StkFloat getMass(void)
Get the current sphere mass.
Definition: Sphere.h:54
void setRadius(StkFloat radius)
Set the radius of the sphere.
Definition: Sphere.h:33
void setVelocity(StkFloat x, StkFloat y, StkFloat z)
Set the 3D velocity of the sphere.
Definition: Sphere.h:30
void setPosition(StkFloat x, StkFloat y, StkFloat z)
Set the 3D center position of the sphere.
Definition: Sphere.h:27
void tick(StkFloat timeIncrement)
Move the sphere for the given time increment.
Definition: Sphere.h:70
STK base class.
Definition: Stk.h:144
STK 3D vector class.
Definition: Vector3D.h:20
void setXYZ(StkFloat x, StkFloat y, StkFloat z)
Set the X, Y, and Z values simultaniously.
Definition: Vector3D.h:39
void setZ(StkFloat z)
Set the Z value.
Definition: Vector3D.h:48
void setY(StkFloat y)
Set the Y value.
Definition: Vector3D.h:45
void setX(StkFloat x)
Set the X value.
Definition: Vector3D.h:42
StkFloat getX(void)
Get the current X value.
Definition: Vector3D.h:27
StkFloat getZ(void)
Get the current Z value.
Definition: Vector3D.h:33
StkFloat getY(void)
Get the current Y value.
Definition: Vector3D.h:30
The STK namespace.
Definition: ADSR.h:8