1.0.0 • Published 2 years ago

aframe-curves v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

AFrame-Curves

Components for dealing with spline curves

curve component

This defines a Catmull-Rom spline curve. It is exposed on el.components.curve.curve,

PropertyTypeDescriptionDefault
tensionnumberThe Catmull-Rom Tension0.25
closedbooleanWhether it joins back up with it's tailfalse

curve-point component

A point that tracks itself in 3D world space and updates the curve that it has changed.

No configuration required

draw-curve component

PropertyTypeDescriptionDefault
curveselectorCurve to draw, defaults to the curve on the same entity.
spacingnumberHow far apart to place the line segments, smaller is a smoother curve.0.5
tangentbooleanDraw curve tangentsfalse
normalbooleanDraw curve normalsfalse
lengthnumberLength to draw the normal and tangent markers0.1

clone-along-curve component

Apply this to the curve element, or set one seperately, to instance element at fixed intervals along a curve. They will be rotated to follw the curve.

PropertyTypeDescriptionDefault
curveselectorOptional, pick a particular curve to use, it defaults to the curve on it's own element
spacingnumberHow far apart to place the elements1
scalevec3Scale of the elements{"x":1,"y":1,"z":1}

<a-curve>

Describes a curve doesn't display anything unless one of the other components is used

Default Components:

Default componentSettings
curve{}

Entity Attribute Mappings:

PropertyMapping
closed"curve.closed"
tension"curve.tension"

<a-curve-point>

This is used to set the control points of the curve, they don't need to be immediate children.

Default Components:

Default componentSettings
curve-point{}

<a-draw-curve>

Describes a curve this uses the draw-curve component to draw a line where the curve is.

Default Components:

Default componentSettings
draw-curve{}
curve{}

Entity Attribute Mappings:

PropertyMapping
curve"draw-curve.curve"
closed"curve.closed"
tension"curve.tension"