Class: MSPhysics::BallAndSocket

Inherits:
Joint show all
Defined in:
RubyExtension/MSPhysics/joint_ball_and_socket.rb

Overview

Since:

  • 1.0.0

Constant Summary

DEFAULT_MAX_CONE_ANGLE =

Since:

  • 1.0.0

30.0.degrees
DEFAULT_CONE_LIMITS_ENABLED =

Since:

  • 1.0.0

false
DEFAULT_MIN_TWIST_ANGLE =

Since:

  • 1.0.0

-180.0.degrees
DEFAULT_MAX_TWIST_ANGLE =

Since:

  • 1.0.0

180.0.degrees
DEFAULT_TWIST_LIMITS_ENABLED =

Since:

  • 1.0.0

false
DEFAULT_FRICTION =

Since:

  • 1.0.0

0.0
DEFAULT_CONTROLLER =

Since:

  • 1.0.0

1.0

Constants inherited from Joint

Joint::DEFAULT_BODIES_COLLIDABLE, Joint::DEFAULT_BREAKING_FORCE, Joint::DEFAULT_SOLVER_MODEL, Joint::DEFAULT_STIFFNESS

Instance Method Summary collapse

Methods inherited from Joint

#address, all_joints, #bodies_collidable=, #bodies_collidable?, #breaking_force, #breaking_force=, #child, #connect, #connected?, #destroy, #disconnect, #dof, #get_pin_matrix, #get_pin_matrix2, #group, joint_by_address, #name, #name=, #parent, #set_pin_matrix, #solver_model, #solver_model=, #stiffness, #stiffness=, #type, #valid?, validate, #world

Methods inherited from Entity

#inspect, #to_s

Constructor Details

#initialize(world, parent, pin_tra, group = nil) ⇒ BallAndSocket

Create a ball & socket joint.

Parameters:

  • world (MSPhysics::World)
  • parent (MSPhysics::Body, nil)
  • pin_tra (Geom::Transformation, Array<Numeric>)

    Pin transformation in global space. Matrix origin is interpreted as the pin position. Matrix Z-axis is interpreted as the pin direction.

  • group (Sketchup::Group, Sketchup::ComponentInstance, nil) (defaults to: nil)

Since:

  • 1.0.0

Instance Method Details

#cone_limits_enabled=(state) ⇒ Object

Enable/disable cone angle limits.

Parameters:

  • state (Boolean)

Since:

  • 1.0.0

#cone_limits_enabled?Boolean

Determine whether cone angle limits are enabled.

Returns:

  • (Boolean)

Since:

  • 1.0.0

#controllerNumeric

Note:

Default controller value is 1.0.

Note:

The actual friction is friction * controller.

Get magnitude of the angular friction.

Returns:

  • (Numeric)

Since:

  • 1.0.0

#controller=(value) ⇒ Object

Note:

Default controller value is 1.0.

Note:

The actual friction is friction * controller.

Set magnitude of the angular friction.

Parameters:

  • value (Numeric)

Since:

  • 1.0.0

#cur_cone_angleNumeric

Get current cone angle in radians.

Returns:

  • (Numeric)

Since:

  • 1.0.0

#cur_twist_alphaNumeric

Get current twist acceleration in radians per second per second.

Returns:

  • (Numeric)

Since:

  • 1.0.0

#cur_twist_angleNumeric

Get current twist angle in radians.

Returns:

  • (Numeric)

Since:

  • 1.0.0

#cur_twist_omegaNumeric

Get current twist omega in radians per second.

Returns:

  • (Numeric)

Since:

  • 1.0.0

#frictionNumeric

Note:

The actual friction is friction * controller.

Get angular friction.

Returns:

  • (Numeric)

    A value greater than or equal to zero.

Since:

  • 1.0.0

#friction=(value) ⇒ Object

Note:

The actual friction is friction * controller.

Set angular friction.

Parameters:

  • value (Numeric)

    A value greater than or equal to zero.

Since:

  • 1.0.0

#max_cone_angleNumeric

Get maximum cone angle in radians.

Returns:

  • (Numeric)

    A value between 0.0 and PI.

Since:

  • 1.0.0

#max_cone_angle=(angle) ⇒ Object

Set maximum cone angle in radians.

Parameters:

  • angle (Numeric)

    A value between 0.0 and PI.

Since:

  • 1.0.0

#max_twist_angleNumeric

Get maximum twist angle in radians.

Returns:

  • (Numeric)

Since:

  • 1.0.0

#max_twist_angle=(angle) ⇒ Object

Set maximum twist angle in radians.

Parameters:

  • angle (Numeric)

Since:

  • 1.0.0

#min_twist_angleNumeric

Get minimum twist angle in radians.

Returns:

  • (Numeric)

Since:

  • 1.0.0

#min_twist_angle=(angle) ⇒ Object

Set minimum twist angle in radians.

Parameters:

  • angle (Numeric)

Since:

  • 1.0.0

#twist_limits_enabled=(state) ⇒ Object

Enable/disable twist angle limits.

Parameters:

  • state (Boolean)

Since:

  • 1.0.0

#twist_limits_enabled?Boolean

Determine whether twist angle limits are enabled.

Returns:

  • (Boolean)

Since:

  • 1.0.0