i6engine  1.0
PhysicsConfig.h
Go to the documentation of this file.
1 /*
2  * i6engine
3  * Copyright (2016) Daniel Bonrath, Michael Baer, All rights reserved.
4  *
5  * This file is part of i6engine; i6engine is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
25 #ifndef __I6ENGINE_API_PHYSICSCONFIG_H__
26 #define __I6ENGINE_API_PHYSICSCONFIG_H__
27 
31 
32 namespace i6e {
33 namespace api {
34 namespace physics {
35 
62  };
63 
70  Physics_Collision_Update(const int64_t i, const int64_t compId, const CollisionGroup & f);
73 
80  Physics_Gravity_Update(const Vec3 & v);
83 
95 
96  Physics_Node_Create(const int64_t i, const int64_t ci, const Vec3 & p, const Quaternion & r, const Vec3 & s, const CollisionGroup & cg, const PhysicalStateComponent::ShapeType st, const attributeMap & pa, const ShatterInterest si);
97  Physics_Node_Create * copy() { return new Physics_Node_Create(*this); }
99 
106  Physics_Node_Update(const int64_t i, const int64_t ci, const Quaternion & r, const Vec3 & s);
107  Physics_Node_Update * copy() { return new Physics_Node_Update(*this); }
109 
115  Physics_NodePosition_Update(const int64_t i, const int64_t ci, const Vec3 & p);
118 
124  Physics_LinearVelocity_Update(const int64_t i, const int64_t ci, const Vec3 & v) : GameMessageStruct(ci, i), linVel(v) {
125  }
128 
132  typedef std::tuple<Vec3, Vec3, bool> Force;
134  std::vector<Force> forces;
135  Physics_Force_Update(const int64_t i, const int64_t ci, const std::vector<Force> & fs) : GameMessageStruct(ci, i), forces(fs) {
136  }
137  Physics_Force_Update * copy() { return new Physics_Force_Update(*this); }
139 
146  Physics_Comp_Update(const int64_t i, const int64_t ci, const Vec3 & v, const Vec3 & f) : GameMessageStruct(ci, i), linVel(v), centForce(f) {
147  }
148  Physics_Comp_Update * copy() { return new Physics_Comp_Update(*this); }
150 
156  Physics_ApplyRotation_Update(const int64_t i, const int64_t ci, const Quaternion & rotation);
159 
164  Physics_Reset_Update(const int64_t i, const int64_t ci) : GameMessageStruct(ci, i) {
165  }
166  Physics_Reset_Update * copy() { return new Physics_Reset_Update(*this); }
168 
175  Physics_NodeGravity_Update(const int64_t i, const int64_t ci, const Vec3 & grav) : GameMessageStruct(ci, i), gravity(grav) {
176  }
179 
184  Physics_Node_Delete(const int64_t i, const int64_t ci);
185  Physics_Node_Delete * copy() { return new Physics_Node_Delete(*this); }
187 
197 
198  Physics_RayTest_Update(const int64_t i, const int64_t ci, const Vec3 & f, const Vec3 & t, PhysicalStateComponent::RayTestRepetition rtr, PhysicalStateComponent::RayTestNotify rtn, const GameMessage::Ptr & msg);
201 
207 
208  Physics_RayTestNotify_Update(const int64_t i, const int64_t ci);
211 
217  bool pause;
218  Physics_Pause_Update(bool p) : pause(p) {
219  }
221  return new Physics_Pause_Update(*this);
222  }
224 
230  Physics_AddPosition_Update(const int64_t i, const int64_t ci, const Vec3 & p);
232  return new Physics_AddPosition_Update(*this);
233  }
235 
240  int64_t targetGOID;
243  Physics_P2PConstraint_Create(const int64_t goid, const int64_t targetGoid, const Vec3 & s, const Vec3 & t) : GameMessageStruct(-1, goid), targetGOID(targetGoid), selfOffset(s), targetOffset(t) {
244  }
246  return new Physics_P2PConstraint_Create(*this);
247  }
249 
254  int64_t targetGOID;
256  Physics_BreakConstraintImpulse_Update(const int64_t goid, const int64_t targetGoid, double bi) : GameMessageStruct(-1, goid), targetGOID(targetGoid), breakingImpulse(bi) {
257  }
259  return new Physics_BreakConstraintImpulse_Update(*this);
260  }
262 
267  int64_t targetGOID;
268  Physics_Constraint_Delete(const int64_t goid, const int64_t targetGoid) : GameMessageStruct(-1, goid), targetGOID(targetGoid) {
269  }
271  return new Physics_Constraint_Delete(*this);
272  }
274 
279  double maxSpeed;
281  double windage;
282  Physics_VelocityComponent_Create(const int64_t coid, const int64_t goid, double ms, double rc, double w) : GameMessageStruct(coid, goid), maxSpeed(ms), resistanceCoefficient(rc), windage(w) {
283  }
285  return new Physics_VelocityComponent_Create(*this);
286  }
288 
293  Physics_VelocityComponent_Delete(const int64_t coid, const int64_t goid) : GameMessageStruct(coid, goid) {
294  }
296  return new Physics_VelocityComponent_Delete(*this);
297  }
299 
306  std::function<void(void)> callback;
307  Physics_Accelerate_Update(const int64_t coid, const int64_t goid, const Vec3 & a, VelocityComponent::MaxSpeedHandling h, const std::function<void(void)> & cb) : GameMessageStruct(coid, goid), acceleration(a), handling(h), callback(cb) {
308  }
310  return new Physics_Accelerate_Update(*this);
311  }
313 
320  std::function<void(void)> callback;
321  Physics_Decelerate_Update(const int64_t coid, const int64_t goid, const Vec3 & d, VelocityComponent::DecelerationHandling h, const std::function<void(void)> & cb) : GameMessageStruct(coid, goid), deceleration(d), handling(h), callback(cb) {
322  }
324  return new Physics_Decelerate_Update(*this);
325  }
327 
332  Physics_StopAcceleration_Update(const int64_t coid, const int64_t goid) : GameMessageStruct(coid, goid) {
333  }
335  return new Physics_StopAcceleration_Update(*this);
336  }
338 
343  double maxSpeed;
344  Physics_SetMaxSpeed_Update(const int64_t coid, const int64_t goid, double ms) : GameMessageStruct(coid, goid), maxSpeed(ms) {
345  }
347  return new Physics_SetMaxSpeed_Update(*this);
348  }
350 
356  Physics_SetResistanceCoefficient_Update(const int64_t coid, const int64_t goid, double rc) : GameMessageStruct(coid, goid), resistanceCoefficient(rc) {
357  }
359  return new Physics_SetResistanceCoefficient_Update(*this);
360  }
362 
367  double windage;
368  Physics_SetWindage_Update(const int64_t coid, const int64_t goid, double w) : GameMessageStruct(coid, goid), windage(w) {
369  }
371  return new Physics_SetWindage_Update(*this);
372  }
374 
375 } /* namespace physics */
376 } /* namespace api */
377 } /* namespace i6e */
378 
379 #endif /* __I6ENGINE_API_PHYSICSCONFIG_H__ */
380 
i6e::api::physics::Physics_Pause_Update Physics_Pause_Update
pauses the subsystem never send through network
message for creation of new PhysicsNode
Definition: PhysicsConfig.h:87
Physics_Decelerate_Update * copy()
Copy method returning an exact copy of itself.
i6e::api::physics::Physics_LinearVelocity_Update Physics_LinearVelocity_Update
sets the linear velocity of a PhysicsNode
sets the linear velocity of a PhysicsNode
i6e::api::physics::Physics_Reset_Update Physics_Reset_Update
removes all powers from a PhysicsNode
message for creation of a VelocityComponent in Physics
Physics_Node_Update(const int64_t i, const int64_t ci, const Quaternion &r, const Vec3 &s)
PhysicalStateComponent::RayTestRepetition raytestRepetition
Physics_VelocityComponent_Create * copy()
Copy method returning an exact copy of itself.
Physics_StopAcceleration_Update(const int64_t coid, const int64_t goid)
Physics_Collision_Update * copy()
Copy method returning an exact copy of itself.
Definition: PhysicsConfig.h:71
Class describing a 3d rotation.
Definition: i6eQuaternion.h:58
Physics_Constraint_Delete * copy()
Copy method returning an exact copy of itself.
Physics_BreakConstraintImpulse_Update(const int64_t goid, const int64_t targetGoid, double bi)
i6e::api::physics::Physics_Constraint_Delete Physics_Constraint_Delete
message for deletion of a Constraint between two PhysicsNodes
i6e::api::physics::Physics_Force_Update Physics_Force_Update
i6e::api::physics::Physics_AddPosition_Update Physics_AddPosition_Update
message for addition of object position (cumulative)
Physics_Node_Create * copy()
Copy method returning an exact copy of itself.
Definition: PhysicsConfig.h:97
i6e::api::physics::Physics_Gravity_Update Physics_Gravity_Update
sends update for world gravity
#define ISIXE_MODULES_API
Physics_P2PConstraint_Create * copy()
Copy method returning an exact copy of itself.
Physics_Node_Update * copy()
Copy method returning an exact copy of itself.
ShapeType
Different shape types supported by i6engine.
message for deceleration of VelocityComponent
i6e::api::physics::Physics_StopAcceleration_Update Physics_StopAcceleration_Update
message for stopping acceleration of VelocityComponent
Physics_Accelerate_Update * copy()
Copy method returning an exact copy of itself.
i6e::api::physics::Physics_P2PConstraint_Create Physics_P2PConstraint_Create
message for creation of Point2PointConstraint between two PhysicsNodes
Physics_AddPosition_Update * copy()
Copy method returning an exact copy of itself.
Physics_VelocityComponent_Create(const int64_t coid, const int64_t goid, double ms, double rc, double w)
Physics_NodeGravity_Update(const int64_t i, const int64_t ci, const Vec3 &grav)
PhysicalStateComponent::RayTestNotify raytestNotify
boost::shared_ptr< Message > Ptr
Definition: Message.h:66
PhysicalStateComponent::ShapeType shapeType
Definition: PhysicsConfig.h:92
message for creation of a VelocityComponent in Physics
std::map< std::string, std::string > attributeMap
Definition: attributeMap.h:42
i6e::api::physics::Physics_ApplyRotation_Update Physics_ApplyRotation_Update
applies new rotation to PhysicsNode
message for stopping acceleration of VelocityComponent
i6e::api::physics::Physics_VelocityComponent_Delete Physics_VelocityComponent_Delete
message for deletion of a VelocityComponent in Physics
Physics_Comp_Update(const int64_t i, const int64_t ci, const Vec3 &v, const Vec3 &f)
Physics_Constraint_Delete(const int64_t goid, const int64_t targetGoid)
Physics_Node_Delete(const int64_t i, const int64_t ci)
sends update of collision flags vom PhysicalStateComponent to PhysicsNode
Definition: PhysicsConfig.h:67
Physics_RayTest_Update(const int64_t i, const int64_t ci, const Vec3 &f, const Vec3 &t, PhysicalStateComponent::RayTestRepetition rtr, PhysicalStateComponent::RayTestNotify rtn, const GameMessage::Ptr &msg)
ShatterInterest
Different flags for collision interest.
applies new rotation to PhysicsNode
Physics_SetResistanceCoefficient_Update(const int64_t coid, const int64_t goid, double rc)
Physics_SetMaxSpeed_Update(const int64_t coid, const int64_t goid, double ms)
Physics_SetWindage_Update * copy()
Copy method returning an exact copy of itself.
Implements 3-dimensional vectors.
Definition: i6eVector.h:48
message for acceleration of VelocityComponent
sends message to PhysicalStateComponent with updates of velocity and impulse
message for creation of new PhysicsNode
i6e::api::physics::Physics_SetWindage_Update Physics_SetWindage_Update
message for creation of a VelocityComponent in Physics
Physics_LinearVelocity_Update(const int64_t i, const int64_t ci, const Vec3 &v)
Physics_Comp_Update * copy()
Copy method returning an exact copy of itself.
Physics_Force_Update(const int64_t i, const int64_t ci, const std::vector< Force > &fs)
Physics_Pause_Update * copy()
Copy method returning an exact copy of itself.
Physics_Reset_Update * copy()
Copy method returning an exact copy of itself.
Physics_ApplyRotation_Update(const int64_t i, const int64_t ci, const Quaternion &rotation)
i6e::api::physics::Physics_Accelerate_Update Physics_Accelerate_Update
message for acceleration of VelocityComponent
message for deletion of a VelocityComponent in Physics
removes all powers from a PhysicsNode
Physics_SetResistanceCoefficient_Update * copy()
Copy method returning an exact copy of itself.
i6e::api::physics::Physics_NodeGravity_Update Physics_NodeGravity_Update
sets the gravity for the given object This overrides the default gravity, thus (0, 0, 0) will result in no gravity at all
Physics_StopAcceleration_Update * copy()
Copy method returning an exact copy of itself.
Physics_Gravity_Update * copy()
Copy method returning an exact copy of itself.
Definition: PhysicsConfig.h:81
Physics_Accelerate_Update(const int64_t coid, const int64_t goid, const Vec3 &a, VelocityComponent::MaxSpeedHandling h, const std::function< void(void)> &cb)
i6e::api::physics::Physics_SetResistanceCoefficient_Update Physics_SetResistanceCoefficient_Update
message for creation of a VelocityComponent in Physics
Physics_SetWindage_Update(const int64_t coid, const int64_t goid, double w)
message for creation of Point2PointConstraint between two PhysicsNodes
pauses the subsystem never send through network
Physics_NodePosition_Update(const int64_t i, const int64_t ci, const Vec3 &p)
struct containing information from raytest objID: id of GO hit first by the ray sourceID: id of the s...
message for deletion of new PhysicsNode
message for update of PhysicsNode position
VelocityComponent::DecelerationHandling handling
struct containing the collision info for an object
message for deletion of a Constraint between two PhysicsNodes
i6e::api::physics::Physics_NodePosition_Update Physics_NodePosition_Update
message for update of PhysicsNode position
VelocityComponent::MaxSpeedHandling handling
Physics_Force_Update * copy()
Copy method returning an exact copy of itself.
Physics_RayTestNotify_Update * copy()
Copy method returning an exact copy of itself.
i6e::api::physics::Physics_VelocityComponent_Create Physics_VelocityComponent_Create
message for creation of a VelocityComponent in Physics
std::tuple< Vec3, Vec3, bool > Force
applies a central impulse for a PhysicsNode
Physics_ApplyRotation_Update * copy()
Copy method returning an exact copy of itself.
Physics_VelocityComponent_Delete(const int64_t coid, const int64_t goid)
Physics_Node_Delete * copy()
Copy method returning an exact copy of itself.
Physics_NodeGravity_Update * copy()
Copy method returning an exact copy of itself.
i6e::api::physics::Physics_Comp_Update Physics_Comp_Update
sends message to PhysicalStateComponent with updates of velocity and impulse
Physics_SetMaxSpeed_Update * copy()
Copy method returning an exact copy of itself.
message for setting breaking impulse for Constraint between two PhysicsNodes
i6e::api::physics::Physics_Node_Delete Physics_Node_Delete
message for deletion of new PhysicsNode
i6e::api::physics::Physics_SetMaxSpeed_Update Physics_SetMaxSpeed_Update
message for setting maxSpeed of a VelocityComponent
i6e::api::physics::Physics_RayTest_Update Physics_RayTest_Update
message for raytest
message for creation of a VelocityComponent in Physics
i6e::api::physics::Physics_Node_Create Physics_Node_Create
message for creation of new PhysicsNode
Physics_P2PConstraint_Create(const int64_t goid, const int64_t targetGoid, const Vec3 &s, const Vec3 &t)
i6e::api::physics::Physics_RayTestNotify_Update Physics_RayTestNotify_Update
message for raytest feedback
i6e::api::physics::Physics_Collision_Update Physics_Collision_Update
sends update of collision flags vom PhysicalStateComponent to PhysicsNode
Physics_VelocityComponent_Delete * copy()
Copy method returning an exact copy of itself.
message for setting maxSpeed of a VelocityComponent
sets the gravity for the given object This overrides the default gravity, thus (0, 0, 0) will result in no gravity at all
Physics_BreakConstraintImpulse_Update * copy()
Copy method returning an exact copy of itself.
RayTestNotify
Different flags for the kind of notify mechanism of raytest.
i6e::api::physics::Physics_BreakConstraintImpulse_Update Physics_BreakConstraintImpulse_Update
message for setting breaking impulse for Constraint between two PhysicsNodes
Physics_AddPosition_Update(const int64_t i, const int64_t ci, const Vec3 &p)
i6e::api::physics::Physics_Node_Update Physics_Node_Update
message for creation of new PhysicsNode
Physics_RayTest_Update * copy()
Copy method returning an exact copy of itself.
sends update for world gravity
Definition: PhysicsConfig.h:77
Physics_Reset_Update(const int64_t i, const int64_t ci)
i6e::api::physics::Physics_Decelerate_Update Physics_Decelerate_Update
message for deceleration of VelocityComponent
Physics_LinearVelocity_Update * copy()
Copy method returning an exact copy of itself.
RayTestRepetition
Different flags for kind of raytest repetition.
Physics_Decelerate_Update(const int64_t coid, const int64_t goid, const Vec3 &d, VelocityComponent::DecelerationHandling h, const std::function< void(void)> &cb)
Physics_NodePosition_Update * copy()
Copy method returning an exact copy of itself.
message for addition of object position (cumulative)
Physics_Node_Create(const int64_t i, const int64_t ci, const Vec3 &p, const Quaternion &r, const Vec3 &s, const CollisionGroup &cg, const PhysicalStateComponent::ShapeType st, const attributeMap &pa, const ShatterInterest si)