Skyscraper 2.0
SBS::Vehicle Class Reference

#include <vehicle.h>

Inheritance diagram for SBS::Vehicle:
Collaboration diagram for SBS::Vehicle:

Public Member Functions

 Vehicle (Object *parent, const int number)
 
 ~Vehicle ()
 
bool CreateChassis (Real restitution, Real friction, Real mass, Real linear_dampening, Real angular_dampening)
 
bool AddWheel (bool engine, bool steerable, bool IsFrontWheel, Real radius, const Vector3 &ConnectionPoint, const Vector3 &Direction=Vector3(0, -1, 0), const Vector3 &Axle=Vector3(-1, 0, 0))
 
void KeyPressed (bool left, bool right, bool down, bool up)
 
void KeyReleased (bool left, bool right, bool down, bool up)
 
void Loop ()
 
void Enabled (bool value)
 
bool Create (const Vector3 &position)
 
void OnMove (bool parent)
 
void AttachCamera (bool value)
 
Real GetWidth ()
 
void Report (const std::string &message)
 
bool ReportError (const std::string &message)
 
- Public Member Functions inherited from SBS::Object
 Object (Object *parent)
 
virtual ~Object ()
 
void SetValues (const std::string &type, const std::string &name, bool is_permanent, bool is_movable=true)
 
bool IsPermanent ()
 
bool IsMovable ()
 
const std::string & GetType ()
 
int GetNumber ()
 
void AddChild (Object *object)
 
ObjectGetChild (int index)
 
int GetChildrenCount ()
 
void RemoveChild (Object *object)
 
SceneNodeGetSceneNode ()
 
void ShowBoundingBox (bool value)
 
virtual void Move (const Vector3 &vector, Real speed=1.0)
 
virtual void Move (Real X, Real Y, Real Z, Real speed=1.0)
 
virtual void SetPosition (const Vector3 &position)
 
void SetPositionRelative (const Vector3 &position)
 
virtual void SetPosition (Real X, Real Y, Real Z)
 
void SetPositionRelative (Real X, Real Y, Real Z)
 
virtual void SetPositionY (Real value)
 
virtual Vector3 GetPosition (bool relative=false)
 
virtual void Rotate (const Vector3 &vector, Real speed=1.0)
 
virtual void Rotate (Real X, Real Y, Real Z, Real speed=1.0)
 
virtual void SetRotation (const Vector3 &rotation)
 
virtual void SetRotation (Real X, Real Y, Real Z)
 
virtual Vector3 GetRotation ()
 
Quaternion GetOrientation (bool relative=false)
 
void SetOrientation (const Quaternion &q, bool relative=false)
 
virtual void OnRotate (bool parent)
 
virtual void OnClick (Vector3 &position, bool shift, bool ctrl, bool alt, bool right)
 
virtual void OnUnclick (bool right)
 
virtual void OnHit ()
 
void NotifyMove (bool parent=false)
 
void NotifyRotate (bool parent=false)
 
virtual void ResetState ()
 
void ChangeParent (Object *new_parent)
 
bool IsGlobal ()
 
void Init (bool children=true)
 
virtual void OnInit ()
 
void RegisterLoop (Object *object)
 
void UnregisterLoop (Object *object)
 
std::string GetNameBase ()
 
template<typename T >
bool IsType ()
 
template<typename T >
T * ConvertTo ()
 
- Public Member Functions inherited from SBS::ObjectBase
 ObjectBase (Object *parent)
 
virtual ~ObjectBase ()
 
ObjectGetParent ()
 
SBSGetRoot ()
 
void SetName (const std::string &name)
 
const std::string & GetName ()
 
std::string GetNameBase ()
 

Public Attributes

int Number
 
std::string Name
 
bool Created
 
Vector3 ChassisShift
 
std::string ChassisMesh
 
std::string WheelMesh
 
Real ChassisScale
 
Real WheelScale
 
Vector3 CameraPoint
 
Real MaxEngineForce
 
Real SteeringIncrement
 
Real SteeringClamp
 
Real WheelFriction
 
Real SuspensionStiffness
 
Real SuspensionDamping
 
Real SuspensionCompression
 
Real RollInfluence
 
Real SuspensionRestLength
 
Real MaxSuspensionTravelCm
 
Real FrictionSlip
 
- Public Attributes inherited from SBS::Object
std::string command
 
std::string command_processed
 
std::string context
 
int linenum
 
std::string includefile
 
bool parent_deleting
 

Private Attributes

OgreBulletDynamics::WheeledRigidBody * mCarChassis
 
OgreBulletDynamics::VehicleTuning * mTuning
 
OgreBulletDynamics::VehicleRayCaster * mVehicleRayCaster
 
OgreBulletDynamics::RaycastVehicle * mVehicle
 
Objectvehicle
 
MeshObjectmChassis
 
std::vector< MeshObject * > mWheels
 
int WheelCount
 
std::vector< int > mWheelsEngine
 
std::vector< int > mWheelsSteerable
 
Real mEngineForce
 
Real mSteering
 
bool mSteeringLeft
 
bool mSteeringRight
 
bool camera_attached
 

Additional Inherited Members

- Protected Member Functions inherited from SBS::Object
void EnableLoop (bool value)
 
void LoopChildren ()
 
bool SelfDestruct ()
 
- Protected Attributes inherited from SBS::ObjectBase
SBSsbs
 

Detailed Description

Definition at line 36 of file vehicle.h.

Constructor & Destructor Documentation

◆ Vehicle()

◆ ~Vehicle()

Member Function Documentation

◆ AddWheel()

bool SBS::Vehicle::AddWheel ( bool engine,
bool steerable,
bool IsFrontWheel,
Real radius,
const Vector3 & ConnectionPoint,
const Vector3 & Direction = Vector3(0, -1, 0),
const Vector3 & Axle = Vector3(-1, 0, 0) )

◆ AttachCamera()

void SBS::Vehicle::AttachCamera ( bool value)

Definition at line 318 of file vehicle.cpp.

References camera_attached, CameraPoint, and Report().

Referenced by SBS::Camera::AttachToVehicle(), and ~Vehicle().

Here is the call graph for this function:

◆ Create()

bool SBS::Vehicle::Create ( const Vector3 & position)

Definition at line 144 of file vehicle.cpp.

References Created, SBS::Object::Move(), ReportError(), and vehicle.

Referenced by SBS::SBS::NewVehicle(), and Skyscraper::ScriptProcessor::VehicleSection::Run().

Here is the call graph for this function:

◆ CreateChassis()

◆ Enabled()

void SBS::Vehicle::Enabled ( bool value)
virtual

Reimplemented from SBS::Object.

Definition at line 307 of file vehicle.cpp.

References SBS::Object::EnableLoop().

Referenced by Vehicle().

Here is the call graph for this function:

◆ GetWidth()

Real SBS::Vehicle::GetWidth ( )

Definition at line 332 of file vehicle.cpp.

References SBS::MeshObject::Bounds, and mChassis.

Referenced by SBS::Camera::AttachToVehicle().

◆ KeyPressed()

void SBS::Vehicle::KeyPressed ( bool left,
bool right,
bool down,
bool up )

Definition at line 235 of file vehicle.cpp.

References MaxEngineForce, mEngineForce, mSteeringLeft, and mSteeringRight.

Referenced by SBS::Camera::Drive().

◆ KeyReleased()

void SBS::Vehicle::KeyReleased ( bool left,
bool right,
bool down,
bool up )

Definition at line 247 of file vehicle.cpp.

References mEngineForce, mSteeringLeft, and mSteeringRight.

Referenced by SBS::Camera::Drive().

◆ Loop()

◆ OnMove()

void SBS::Vehicle::OnMove ( bool parent)
virtual

Reimplemented from SBS::Object.

Definition at line 312 of file vehicle.cpp.

References mCarChassis.

◆ Report()

void SBS::Vehicle::Report ( const std::string & message)
virtual

Reimplemented from SBS::ObjectBase.

Definition at line 344 of file vehicle.cpp.

References SBS::ObjectBase::GetName(), and SBS::ObjectBase::Report().

Referenced by AttachCamera().

Here is the call graph for this function:

◆ ReportError()

bool SBS::Vehicle::ReportError ( const std::string & message)
virtual

Reimplemented from SBS::ObjectBase.

Definition at line 350 of file vehicle.cpp.

References SBS::ObjectBase::GetName(), and SBS::ObjectBase::ReportError().

Referenced by AddWheel(), Create(), and CreateChassis().

Here is the call graph for this function:

Member Data Documentation

◆ camera_attached

bool SBS::Vehicle::camera_attached
private

Definition at line 98 of file vehicle.h.

Referenced by AttachCamera(), Loop(), and Vehicle().

◆ CameraPoint

Vector3 SBS::Vehicle::CameraPoint

Definition at line 48 of file vehicle.h.

Referenced by AttachCamera(), Loop(), and Vehicle().

◆ ChassisMesh

std::string SBS::Vehicle::ChassisMesh

Definition at line 44 of file vehicle.h.

Referenced by CreateChassis(), and Skyscraper::ScriptProcessor::VehicleSection::Run().

◆ ChassisScale

Real SBS::Vehicle::ChassisScale

◆ ChassisShift

Vector3 SBS::Vehicle::ChassisShift

◆ Created

bool SBS::Vehicle::Created

Definition at line 41 of file vehicle.h.

Referenced by Create(), and Vehicle().

◆ FrictionSlip

Real SBS::Vehicle::FrictionSlip

◆ MaxEngineForce

Real SBS::Vehicle::MaxEngineForce

Definition at line 50 of file vehicle.h.

Referenced by KeyPressed(), Skyscraper::ScriptProcessor::VehicleSection::Run(), and Vehicle().

◆ MaxSuspensionTravelCm

Real SBS::Vehicle::MaxSuspensionTravelCm

◆ mCarChassis

OgreBulletDynamics::WheeledRigidBody* SBS::Vehicle::mCarChassis
private

Definition at line 79 of file vehicle.h.

Referenced by CreateChassis(), OnMove(), Vehicle(), and ~Vehicle().

◆ mChassis

MeshObject* SBS::Vehicle::mChassis
private

Definition at line 85 of file vehicle.h.

Referenced by CreateChassis(), GetWidth(), Vehicle(), and ~Vehicle().

◆ mEngineForce

Real SBS::Vehicle::mEngineForce
private

Definition at line 92 of file vehicle.h.

Referenced by KeyPressed(), KeyReleased(), Loop(), and Vehicle().

◆ mSteering

Real SBS::Vehicle::mSteering
private

Definition at line 93 of file vehicle.h.

Referenced by Loop(), and Vehicle().

◆ mSteeringLeft

bool SBS::Vehicle::mSteeringLeft
private

Definition at line 95 of file vehicle.h.

Referenced by KeyPressed(), KeyReleased(), Loop(), and Vehicle().

◆ mSteeringRight

bool SBS::Vehicle::mSteeringRight
private

Definition at line 96 of file vehicle.h.

Referenced by KeyPressed(), KeyReleased(), Loop(), and Vehicle().

◆ mTuning

OgreBulletDynamics::VehicleTuning* SBS::Vehicle::mTuning
private

Definition at line 80 of file vehicle.h.

Referenced by CreateChassis(), Vehicle(), and ~Vehicle().

◆ mVehicle

OgreBulletDynamics::RaycastVehicle* SBS::Vehicle::mVehicle
private

Definition at line 82 of file vehicle.h.

Referenced by AddWheel(), CreateChassis(), Loop(), Vehicle(), and ~Vehicle().

◆ mVehicleRayCaster

OgreBulletDynamics::VehicleRayCaster* SBS::Vehicle::mVehicleRayCaster
private

Definition at line 81 of file vehicle.h.

Referenced by CreateChassis(), Vehicle(), and ~Vehicle().

◆ mWheels

std::vector<MeshObject*> SBS::Vehicle::mWheels
private

Definition at line 86 of file vehicle.h.

Referenced by AddWheel(), and ~Vehicle().

◆ mWheelsEngine

std::vector<int> SBS::Vehicle::mWheelsEngine
private

Definition at line 89 of file vehicle.h.

Referenced by AddWheel(), and Loop().

◆ mWheelsSteerable

std::vector<int> SBS::Vehicle::mWheelsSteerable
private

Definition at line 90 of file vehicle.h.

Referenced by AddWheel(), and Loop().

◆ Name

std::string SBS::Vehicle::Name

Definition at line 40 of file vehicle.h.

Referenced by Skyscraper::ScriptProcessor::VehicleSection::Run().

◆ Number

int SBS::Vehicle::Number

Definition at line 39 of file vehicle.h.

Referenced by Vehicle().

◆ RollInfluence

Real SBS::Vehicle::RollInfluence

Definition at line 57 of file vehicle.h.

Referenced by AddWheel(), Skyscraper::ScriptProcessor::VehicleSection::Run(), and Vehicle().

◆ SteeringClamp

Real SBS::Vehicle::SteeringClamp

Definition at line 52 of file vehicle.h.

Referenced by Loop(), Skyscraper::ScriptProcessor::VehicleSection::Run(), and Vehicle().

◆ SteeringIncrement

Real SBS::Vehicle::SteeringIncrement

Definition at line 51 of file vehicle.h.

Referenced by Loop(), Skyscraper::ScriptProcessor::VehicleSection::Run(), and Vehicle().

◆ SuspensionCompression

Real SBS::Vehicle::SuspensionCompression

◆ SuspensionDamping

Real SBS::Vehicle::SuspensionDamping

◆ SuspensionRestLength

Real SBS::Vehicle::SuspensionRestLength

Definition at line 58 of file vehicle.h.

Referenced by AddWheel(), Skyscraper::ScriptProcessor::VehicleSection::Run(), and Vehicle().

◆ SuspensionStiffness

Real SBS::Vehicle::SuspensionStiffness

◆ vehicle

Object* SBS::Vehicle::vehicle
private

Definition at line 84 of file vehicle.h.

Referenced by Create(), CreateChassis(), Vehicle(), and ~Vehicle().

◆ WheelCount

int SBS::Vehicle::WheelCount
private

Definition at line 88 of file vehicle.h.

Referenced by AddWheel(), and Vehicle().

◆ WheelFriction

Real SBS::Vehicle::WheelFriction

Definition at line 53 of file vehicle.h.

Referenced by AddWheel(), Skyscraper::ScriptProcessor::VehicleSection::Run(), and Vehicle().

◆ WheelMesh

std::string SBS::Vehicle::WheelMesh

Definition at line 45 of file vehicle.h.

Referenced by AddWheel(), and Skyscraper::ScriptProcessor::VehicleSection::Run().

◆ WheelScale

Real SBS::Vehicle::WheelScale

Definition at line 47 of file vehicle.h.

Referenced by AddWheel(), Skyscraper::ScriptProcessor::VehicleSection::Run(), and Vehicle().


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