Class: MSPhysics::PointToPoint

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

Overview

Since:

  • 1.0.0

Constant Summary

DEFAULT_ACCEL =

Since:

  • 1.0.0

40.0
DEFAULT_DAMP =

Since:

  • 1.0.0

0.1
DEFAULT_STRENGTH =

Since:

  • 1.0.0

0.80
DEFAULT_MODE =

Since:

  • 1.0.0

0
DEFAULT_START_DISTANCE =

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) ⇒ PointToPoint

Create a PointToPoint 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

#accelNumeric

Get spring oscillation acceleration factor.

Returns:

  • (Numeric)

    A value greater than or equal to zero.

Since:

  • 1.0.0

#accel=(value) ⇒ Object

Set spring oscillation acceleration factor.

Parameters:

  • value (Numeric)

    Spring accel, a value greater than or equal to zero.

Since:

  • 1.0.0

#controllerNumeric

Note:

The actual, desired distance is, start_distance * controller.

Get magnitude of the starting distance.

Returns:

  • (Numeric)

Since:

  • 1.0.0

#controller=(value) ⇒ Object

Note:

The actual, desired distance is, start_distance * controller.

Set magnitude of the starting distance.

Parameters:

  • value (Numeric)

Since:

  • 1.0.0

#cur_distanceNumeric

Get current distance in meters with respect to the starting position.

Returns:

  • (Numeric)

Since:

  • 1.0.0

#dampNumeric

Get spring oscillation drag coefficient.

Returns:

  • (Numeric)

    A value between 0.0 and 1.0.

Since:

  • 1.0.0

#damp=(value) ⇒ Object

Set spring oscillation drag coefficient.

Parameters:

  • value (Numeric)

    Spring damp, a value between 0.0 and 1.0.

Since:

  • 1.0.0

#modeFixnum

Get mode.

Returns:

  • (Fixnum)
    • 0 - preserve distance.

    • 1 - preserve distance and direction.

Since:

  • 1.0.0

#mode=(value) ⇒ Object

Set mode.

Parameters:

  • value (Fixnum)
    • 0 - preserve distance.

    • 1 - preserve distance and direction.

Since:

  • 1.0.0

#start_distanceNumeric

Note:

The actual, desired distance is, start_distance * controller.

Get starting distance in meters.

Returns:

  • (Numeric)

Since:

  • 1.0.0

#start_distance=(value) ⇒ Object

Note:

The actual, desired distance is, start_distance * controller.

Set starting distance in meters.

Parameters:

  • value (Numeric)

Since:

  • 1.0.0

#strengthNumeric

Get spring strength coefficient.

Returns:

  • (Numeric)

    A value between 0.0 and 1.0.

Since:

  • 1.0.0

#strength=(value) ⇒ Object

Set spring strength coefficient.

Parameters:

  • value (Numeric)

    Spring strength, a value between 0.0 and 1.0.

Since:

  • 1.0.0