25 #ifndef __I6ENGINE_API_VELOCITYCOMPONENT_H__
26 #define __I6ENGINE_API_VELOCITYCOMPONENT_H__
74 void accelerate(
const Vec3 & acceleration, MaxSpeedHandling handling,
const std::function<
void(
void)> & callback);
75 void accelerate(
const std::function<
void(
void)> & callback) {
76 accelerate(_acceleration, _handling, callback);
83 void decelerate(
const Vec3 & deceleration, DecelerationHandling handling,
const std::function<
void(
void)> & callback);
84 void decelerate(
const std::function<
void(
void)> & callback) {
85 decelerate(_deceleration, _decelerationHandling, callback);
91 void stopAcceleration()
const;
96 void setMaxSpeed(
double maxSpeed);
101 void setResistanceCoefficient(
double coeff);
106 void setWindage(
double windage);
112 _decelerationHandling = handling;
119 double _resistanceCoefficient;
121 MaxSpeedHandling _handling;
122 DecelerationHandling _decelerationHandling;
124 void Init()
override;
126 void Finalize()
override;
std::string getTemplateName() const override
returns the name this template was registered with
#define ISIXE_MODULES_API
void accelerate(const std::function< void(void)> &callback)
std::map< std::string, std::string > attributeMap
Component for objects with more complex velocity handling than just setting an impulse, e.g. a car For creating a VelocityComponent, these keys are possible: Name Required Type Description Public acceleration yes double acceleration of this GameObject, in m / sē yes deceleration no double breaking acceleration of this GameObject, in m / sē yes maxSpeed yes double maximum speed this GameObject can reach, in m / s yes resistanceCoefficient no double resistance coefficient, default: 0.6 yes windage no double windage of this GameObject, default: 0.8 mē yes handling no int handling for reaching maximum speed, keep maximum speed or stop acceleration to roll out, default: 0 (= KeepSpeed) yes
Implements 3-dimensional vectors.
void setDecelerationHandling(DecelerationHandling handling)
sets the deceleration handling
void decelerate(const std::function< void(void)> &callback)
Component Base Class. All Components must derive from Component.
std::vector< componentOptions > getComponentOptions() override
returns a vector containing all options of the Component being readable and writeable in the editor ...