Difference between revisions of "Moving Objects Along Paths"

From Constructive Labs
Jump to navigation Jump to search
Line 41: Line 41:
  
 
Reset makes MovingToWaypoint false and rests the controller to the StartingWaypoint
 
Reset makes MovingToWaypoint false and rests the controller to the StartingWaypoint
 +
 +
Toggle toggles MovingToWaypoint on and off
  
 
==ScannerController2==
 
==ScannerController2==

Revision as of 18:08, 9 November 2022

Controllers

EllipseMover2

This nonSpatial object is inteneded to move other visual objects along an elliptical(or circular) path.

You set the X and Y radius properties to designate the size and shape of the ellipse. OriginPosition is the center of the ellipse.

the Steps property designates the number of steps around the ellipse that the object will follow

Interval is the number of milliseconds between each step

Running activates or deactivates the EllipseMover

ControlOut of an EllipseMover wired to the ControlIn of an object causes the object to follow an elliptical or circular path defined by this controller

  • xRadius
  • zRadius
  • Steps
  • Running
  • RotateForever
  • OriginPosition
  • Interval
  • CurrentStep

WaypointMover2

A WaypointMover moves an object along a path of Waypoints.

First you must create a number of Waypoint objects to define the path. Each Waypoint's property must be the name of the next Waypoint in the path.

Then you must enter the name of the first waypoint in the path in the WaypointMover's CurrentWaypointName and StartWaypointName properties

Check the MovingToWaypoint property to start the movement

ControlOut wired to the ControlIn of an object causes the object to follow a chain of waypoints

  • CurrentTargetPosition
  • CurrentWaypointName
  • MovingToWaypoint
  • PauseTime
  • Pausing
  • StartWaypointName
  • TimeIntoWaypointMove
  • Velocity - globally changes the velocity for all the waypoints in the chain of waypoints

Reset makes MovingToWaypoint false and rests the controller to the StartingWaypoint

Toggle toggles MovingToWaypoint on and off

ScannerController2

Moves an object along a series of steps in a line from PositionA to PositionB

Steps is the number of steps in the line

Interval is the number of milliseconds between each step.

Running starts and stops the movement

ControlOut wired to the ControlIn of an object causes the object to follow a linear path from a start point to and endpoint

  • Reverse
  • ReverseOnEnd
  • Steps
  • Running
  • PositionA
  • PositionB
  • Interval
  • Current

SineController2

Moves an object along a sinusoidal path

ControlOut wired to the ControlIn of an object causes the object to follow a sinusoidal path

  • XScale
  • YScale
  • Steps
  • Running
  • PhaseAdjust
  • OriginPosition
  • Interval
  • Current

LookAtController2

Controls an object so that the "front of the object is pointed at the LookAtPosition

ControlOut wired to the ControlIn of an object causes the object to keep it's fron oriented at a position

  • LookAtPosition
  • OriginPosition
  • Up

RotationController2

Changes the rotation of an object over time.

Interval is the time in milliseconds between each step

Steps is the number of angle changes (e.g. 4 steps means 90 degrees per satep, 360 means 1 degree per step)

Running starts and stops the rotation

Axis designates the axis around which the object rotates

ControlOut wired to the ControlIn of an object causes the object to rotate

  • Axis
  • Steps
  • Running
  • RotateForever
  • Interval
  • Current

Waypoints

A path that objects can move along can be created by creating a set of waypoint objects that are linked together.

Waypoint object - just create these using the Add->Spatial->MovementControl menu. They look like three arrows (X,Y and Z) radiating from a ball. Place waypoint objects in a row to create a path for other objects to move along. Each waypoint must have the name of the next waypoint in the path set in its NextWaypointNames property. If you are making a circular path, tha last waypoint must have the first waypoint's name set as itsNextWaypointNames property.

Set Position and Rotation of those waypoints in the Property Editor or grab them and move them around. Each waypoint needs to be rotated to point to the next waypoint so that the motion along the path is smooth.

A WaypointMover2 object is used to follow the path of waypoints. Its position changes over time, following the path of waypoints. (You have to set TargetWaypointName and MovingToWaypoint properties to tell it where to move and to start/stop.) see Moving Objects Using Waypoints (below)


AddWaypont.png


Waypoint Properties

NextWaypointNames - text property of a waypoint - when an object gets to this waypoint, then it starts moving to the next waypoint. So you are defining the next waypoint destination along the path. For example, if you are editing waypoint0, you would put Waypoint1 in the NextWaypointNames property to make the path continue to waypoint1. You can put a comma separated list of waypoint names here and one of the waypoints in the list will be chosen at random.

PauseHereForSeconds - number property of a waypoint - pause after getting to this waypoint.

There are options for time to reach the targeted position TimeToTranslate and time to reach target rotation TimeToRotate - these control how fast the go to that waypoint and how fast it will turn to the target orientation.

SmoothRotation - checkbox

SmoothVelocity - checkbox

TimeToTranslate - number

TimeToRotate - number

Need to update these images to conform to the newer version

WaypointProps1.png

WaypointProps2.png

The NextWaypointNames property of a waypoint - controls which waypoint the object will go to after it reaches the current waypoint. You can easily make a loop by specifying the next waypoint as being the starting waypoint etc.

Moving Objects Using Waypoints

Create a WaypointMover2 object.

A WaypointMover2 is a controller object that can follow a path of waypoints. To move other objects along the path, you wire them to the waypointMover2's position, and they will follow.

You must set two properties of a WaypointMover2 object to get it to move along a path of waypoints. There is a MovingToWaypoint checkbox and a TargetWaypointName field. Set those appropriately and it will move. They can also be controlled by wiring.

TargetWaypointName - text property of a WaypointMover2 - destination waypoint of a WaypointMover2 object.

MovingToWaypoint - checkbox property of a WaypointMover2 - enables/disables WaypointMover2 movement towards the current waypoint.


On the WaypointMover2 you want to move towards a waypoint, set the TargetWaypointName to the name of a waypoint, for example "Waypoint0". As soon as you check the MovingToWaypoint checkbox, the object will start moving towards Waypoint0.

Picture of a PropertyEditor for a WaypointMover2 object:

WarpMarker

click on this and be transported there and reparented.

Next: Saving_and_Loading_Zones