Skip to content
This repository was archived by the owner on Sep 5, 2026. It is now read-only.

Attach to [constraint]

Ercan Akyürek edited this page Feb 18, 2015 · 3 revisions

This constraint is kind of useful, if you want to attach your Objects on another Object. Currently, its only possible to attach com.nolimitsframework.scenery.SceneryObject to com.nolimitsframework.scenery.SceneryObject. In other words, all classes which inherits com.nolimitsframework.animation.Transition are attachable. This this is also true for other constraints. In the further updates, I will add more Objects which inherits com.nolimitsframework.animation.Transition such as Trains, Cars, Lights, Sounds, Camera (implemented experimental com.nolimitsframework.camera.Camera), etc.

So let us construct a fictive situation. You have an animated cube Cube1 and want to attach a to Sphere.

You might have something like

Animation Cube1 = new Animation("Scenery: Cube1");
Cube1.addAnimation(SceneryObject.PROPERTY_POSITION, new Vector3f(25.0f, 6.0f, 0.0f), 0.0f, 2.0f, Easing.ELASTIC_IN_OUT);
Cube1.start();

And now you want to add a Sphere1 on it.

SceneryObject Sphere1 = new SceneryObject("Sphere1")
Sphere1.attachConstraint(new AttachTo(Cube1.getObject()));

Well that's it. Let me explain you the both arguments new AttachTo(Object, Tangential) takes.

  • Object: Where to attach?
  • Tangential: In other words: Taking the whole object matrix or only the object position.

Clone this wiki locally