3#include "pixelbullet/physics/physics_serialization.h"
4#include "pixelbullet/physics/physics_types.h"
5#include "pixelbullet/serialization/node.h"
12 RigidBodyMotionType motion_type = RigidBodyMotionType::Dynamic;
14 float linear_damping = 0.05f;
15 float angular_damping = 0.05f;
16 float gravity_scale = 1.0f;
23 node[
"enabled"] << component.enabled;
24 node[
"motionType"] << component.motion_type;
25 node[
"mass"] << component.mass;
26 node[
"linearDamping"] << component.linear_damping;
27 node[
"angularDamping"] << component.angular_damping;
28 node[
"gravityScale"] << component.gravity_scale;
32inline const Node& operator>>(
const Node& node, RigidBodyComponent& component)
34 if (node.has_property(
"enabled"))
36 node[
"enabled"] >> component.enabled;
38 if (node.has_property(
"motionType"))
40 node[
"motionType"] >> component.motion_type;
42 if (node.has_property(
"mass"))
44 node[
"mass"] >> component.mass;
46 if (node.has_property(
"linearDamping"))
48 node[
"linearDamping"] >> component.linear_damping;
50 if (node.has_property(
"angularDamping"))
52 node[
"angularDamping"] >> component.angular_damping;
54 if (node.has_property(
"gravityScale"))
56 node[
"gravityScale"] >> component.gravity_scale;
Represents a hierarchical node capable of storing various data types and supporting YAML serializatio...
Definition node.h:49
Definition rigid_body_component.h:10