hingeJoint property
ComponentDefinition<HingeJoint3DComponent>
get
hingeJoint
Implementation
static ComponentDefinition<HingeJoint3DComponent> get hingeJoint =>
ComponentDefinition<HingeJoint3DComponent>(
type: 'HingeJoint3DComponent',
id: 'hinge_joint_3d_d261402b',
create: HingeJoint3DComponent.new,
hints: _jointHintsFor(
'Hinge Joint 3D',
'Lets two bodies turn about one axis: a door, a wheel.',
Icons.door_front_door_outlined,
groups: const {
'Joint': ['connectedBody', 'anchor', 'axis', 'enabled'],
'Limits': ['useLimits', 'minAngle', 'maxAngle', 'friction'],
'Motor': ['motor', 'motorTarget', 'motorMaxTorque'],
},
fields: {
'axis': const FieldHint(label: 'Axis'),
'useLimits': const FieldHint(label: 'Limited'),
'minAngle': FieldHint(
label: 'Min angle',
unit: AngleUnit.degrees,
visibleWhen: (c) => (c as HingeJoint3DComponent).useLimits,
),
'maxAngle': FieldHint(
label: 'Max angle',
unit: AngleUnit.degrees,
visibleWhen: (c) => (c as HingeJoint3DComponent).useLimits,
),
'friction': const FieldHint(label: 'Friction torque'),
..._motorHints('angle', 'Max torque').map(
(k, v) => MapEntry(k == 'motorMax' ? 'motorMaxTorque' : k, v),
),
},
),
fields: [
..._jointFields<HingeJoint3DComponent>(),
_vector<HingeJoint3DComponent>(
'axis',
(c) => c.axis,
(c, v) => c.axis = v,
),
_bool<HingeJoint3DComponent>(
'useLimits',
(c) => c.useLimits,
(c, v) => c.useLimits = v,
),
_decimal<HingeJoint3DComponent>(
'minAngle',
(c) => c.minAngle,
(c, v) => c.minAngle = v,
),
_decimal<HingeJoint3DComponent>(
'maxAngle',
(c) => c.maxAngle,
(c, v) => c.maxAngle = v,
),
_decimal<HingeJoint3DComponent>(
'friction',
(c) => c.friction,
(c, v) => c.friction = v,
min: 0,
),
FieldDefinition(
name: 'motor',
kind: _motor,
read: (c) => (c as HingeJoint3DComponent).motor,
write: (c, v) =>
(c as HingeJoint3DComponent).motor = v as Motor3DState,
),
_decimal<HingeJoint3DComponent>(
'motorTarget',
(c) => c.motorTarget,
(c, v) => c.motorTarget = v,
),
_decimal<HingeJoint3DComponent>(
'motorMaxTorque',
(c) => c.motorMaxTorque,
(c, v) => c.motorMaxTorque = v,
min: 0,
),
],
);