#pragma once #ifndef _GTAVEHICLE_HPP_ #define _GTAVEHICLE_HPP_ #include #include #include #include /** * @class GTAVehicle * Stores references to the vehicle data and the instance */ struct GTAVehicle : public GTAObject { private: float steerAngle; float throttle; float brake; bool handbrake; public: std::shared_ptr vehicle; VehicleInfo info; glm::vec3 colourPrimary; glm::vec3 colourSecondary; std::map seatOccupants; btRigidBody* physBody; btVehicleRaycaster* physRaycaster; btRaycastVehicle* physVehicle; GTAVehicle(GTAEngine* engine, const glm::vec3& pos, const glm::quat& rot, Model* model, std::shared_ptr data, const VehicleInfo& info, const glm::vec3& prim, const glm::vec3& sec); virtual ~GTAVehicle(); glm::vec3 getPosition() const; glm::quat getRotation() const; Type type() { return Vehicle; } void setSteeringAngle(float); float getSteeringAngle() const; void setThrottle(float); float getThrottle() const; void setBraking(float); float getBraking() const; void setHandbraking(bool); bool getHandbraking() const; void tick(float dt); void ejectAll(); GTAObject* getOccupant(size_t seat); void setOccupant(size_t seat, GTAObject* occupant); virtual bool takeDamage(const DamageInfo& damage); }; #endif