Jump to content

[Plugin] More/Better Constraint Modules.


CaptainKipard

Recommended Posts

One problem I ran into while developing the landing gear for the Skylon is that AFAIK existing FXModuleConstrainPosition and FXModuleLookAtConstraint are too simple.

So I have five requests:

1. A module that allows the position and/or rotation of an object to be constrained to X and/or Y and/or Z position of another object.

2. The same module with an option to have weighted influence from multiple objects.

3. Inverse Kinematics for two objects (like torque arms).

4. LookAt module with weighted influence from multiple targets.

5. The ability to animate the inverse of a targets rotation and/or translation.

Easy?

Difficult?

Edited by Cpt. Kipard
Link to comment
Share on other sites

One problem I ran into while developing the landing gear for the Skylon is that AFAIK existing FXModuleConstrainPosition and FXModuleLookAtConstraint are too simple.

So I have four requests:

1. A module that allows the position and/or rotation of an object to be constrained to X and/or Y and/or Z position of another object.

2. The same module with an option to have weighted influence from multiple objects.

3. Inverse Kinematics for two objects (like torque arms).

4. LookAt module with weighted influence from multiple targets.

Easy?

Difficult?

Mihara has something similar to this with VariableAnimator, but they are only for internal Props, and the targets are internal variables instead of other transforms.

The translation constraint is probably the easiest. usage might look something like this

MODULE
{
name = FXtranslateConstraint
CONSTRAINTRANSLATEFX //block set can be repeated so the mover moves in combinations of X,Y, or Z
{
moversDirection = 0,0,1 //sets the direction the mover will translate in, -1 would flip the direction for the mover
targetName = transformA //target's translation in world space
moversName = transformB //mover's translation in local space
moversMultiplier = 1 //something to reduce or multiply the mover's translation; defaults to 1
moversLimit = 1 // aboslute value the mover can move in a direction.
}
}

Edited by nli2work
Link to comment
Share on other sites

The translation constraint is probably the easiest. usage might look something like this

MODULE
{
name = FXtranslateConstraint
CONSTRAINTRANSLATEFX //block set can be repeated so the mover moves in combinations of X,Y, or Z
{
moversDirection = 0,0,1 //sets the direction the mover will translate in, -1 would flip the direction for the mover
targetName = transformA //target's translation in world space
moversName = transformB //mover's translation in local space
moversMultiplier = 1 //something to reduce or multiply the mover's translation; defaults to 1
moversLimit = 1 // aboslute value the mover can move in a direction.
}
}

That's pretty good but I don't think it would be enough to animate torque arms on its own. The problem with rotations is that tracking the position of the tip of something along a single axis results in motion best described by a trigonometric function, not a linear one. This is exactly why our attempts have been unsuccessful.

In order to animate a LookAt target for torque arms you'd have to take into account the slight horizontal motion away from the vertical axis, as well as halve the vertical motion of the suspension.

I've added one more request to my list.

Edited by Cpt. Kipard
Link to comment
Share on other sites

Iwe had good success porting my unity based test plugins to ksp. Basically anything that works in unity can be ported to ksp with only a little elbow grease (except shaders appearently) i was thinking of porting this http://u3d.as/content/dogzer/inverse-kinematics/2fP to ksp but i decided to use an animation controller script instead for coding simplicity. So if your thinking of coding it yourself for your project Id suggest you look into that if it would suit your needs. Another way would be to use raycasts to set the positions(this might be a lot easier on the cpu than using actual physics) there are tutorials online for car suspensions you can use as templates to get started on that

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...