MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / Object

Class Object

extensions/olcPGEX_RayCastWorld.h:88–124  ·  view source on GitHub ↗

Base class for objects that exist in world

Source from the content-addressed store, hash-verified

86 {
87 // Base class for objects that exist in world
88 class Object
89 {
90 public:
91 // Linkage to user object description
92 uint32_t nGenericID = 0;
93 // Position in tile/world space
94 olc::vf2d pos;
95 // Velocity in tile/world space
96 olc::vf2d vel;
97 // Speed of object
98 float fSpeed = 0.0f;
99 // Angular direction of object
100 float fHeading = 0.0f;
101 // Collision radius of object
102 float fRadius = 0.5f;
103 // Is drawn?
104 bool bVisible = true;
105 // Flag to be removed form world
106 bool bRemove = false;
107 // Can collide with scenery?
108 bool bCollideWithScenery = true;
109 // Notify scenery collision?
110 bool bNotifySceneryCollision = false;
111 // Can collide with other objects?
112 bool bCollideWithObjects = false;
113 // Notify object collisions?
114 bool bNotifyObjectCollision = false;
115 // Can this object be moved by another object?
116 bool bCanBeMoved = true;
117 // Has physics/collisions applied
118 bool bIsActive = true;
119
120 void Walk(const float fWalkSpeed);
121 void Strafe(const float fStrafeSpeed);
122 void Turn(const float fTurnSpeed);
123 void Stop();
124 };
125
126 // The RayCastWorld Engine - Inherit from this, implement abstract
127 // methods, call Update() and Render() when required

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected