Jump to content

Landing Legs


Cepheus

Recommended Posts

Hi all. First time making an modification, and I would like to modify GoDamit\'s LEM legs to extend and retract, similar to the stock landing legs, and NovaSilisko\'s solar panels. I, however, do not have the slightest idea how these legs work, and I haven\'t found any guide explaining how they do.

Also, for all purposes, I do not intend to release this when I\'m done, to prevent me breaking any rules.

Thanks in advance,

Cepheus,

Link to comment
Share on other sites

I\'ve been looking at the DAE file, here is what I know thus far.

It works almost like the winglet rotation, except instead of the rotation amount being tied to the deflection angle in the config (which also determines how much force is applied to 'turn' the ship) there is a new set ofparameters:

// --- landing leg parameters --------

pivotAxis = 0, 0, -1

pivotingAngle = 135

extensionTime = 1.8

retractTime = 1.8

pivotAxis is a vector around which the leg mesh will rotate, and will function like the thrust and attachment vector assignments for the most part. I don\'t think the direction of the vector matters, so in the example (0,0,1) should work just as good. To visualize this axis on the default leg, imagine an axle or bolt through the hinge of the leg. That will be your pivotAxis.

The angle is how far it rotates, from the raised position to deployed. And the 2 time values are how long the animation 'runs'

The other major difference is the internal structure of the object. This is the 1st part with 2 separate collider meshes. The hinge has the main node_collider, which serves as the part attachment point as well, and the rotating leg has a separate collider named 'node_legCollider'

The hinge and leg objects also require specific names:

hinge: obj_anchor

leg: obj_leg

leg collider: node_legCollider

hinge/normal collider: node_collider

Link to comment
Share on other sites

pivotAxis is a vector around which the leg mesh will rotate, and will function like the thrust and attachment vector assignments for the most part. I don\'t think the direction of the vector matters, so in the example (0,0,1) should work just as good. To visualize this axis on the default leg, imagine an axle or bolt through the hinge of the leg. That will be your pivotAxis.

But wich way is positive or negative ( i mean, yaw left is -1 or 1, etc) ?

i\'m trying to do the parasail Gemini ;)

Link to comment
Share on other sites

the negative side of an axis is to the left (or down) yes, because each axis is defined by a 'coordinate plane'

Look over this article: http://en.wikipedia.org/wiki/Cartesian_coordinate_system

Say you had a spaceplane launched and its now flying level over Kerbin. If you view it from behind and above it as it flys away:

The Left wingtip is on the negative side of the X axis, and the right wingtip is positive.

Because the plane launched vertically, the nose is +Y and the tail is -Y, while the belly of plane is -Z and the topside of the fuselage is +Z

(one thing to remember, KSP treats the Y axis as the 'height' or vertical coordinate, whereas it shows Z in the examples on Wiki. There is a reason for this involving engineering in real life, but that is not important, just remember to swap them when working in your 3d software (since Z is usually the vertical coordinate in those, as well)

Also important to remember that each piece has separate internal coordinates (again, tied to that origin point of the model) A lot of parts that radially attach like boosters, lander legs, wings, and such usually have the attaching surface pointing at the +X axis, as you can see in this picture of the lander leg in Blender:

99Miv.png

Red is X, green is Y, Blue is Z, with the colored arrows pointing towards the positive on their axis. (of course, the blue axis will translate to Y once in KSP, and green will be Z..)

Note that the side that attaches is at +X and the green axis runs directly through the place where the leg rotates.

The axis the part attaches on is 1,0,0 (the red, X axis) while the leg rotates on 0,0,1 (the green Z axis in KSP) and you\'ll see those coorindates in the leg\'s config file:

node_attach = 6.88426, 0.0, 0.0, 1.0, 0.0, 0.0

pivotAxis = 0, 0, -1

(the first part of node_attach tells the game how far from 0,0,0 the part should attach, in this case 68 centimeters on the X axis, and no distance on the Y and Z axis)

There is another thread around here where we went into the trigonometry in how these 'vector' coordinates work (search for vector math) if you desire more in depth information.

Link to comment
Share on other sites

Oh, so if i understand correctly this means that, for the gemini skids :

Main left skid is PivotAxis -1,0,0

Main right skid is PivotAxis 1,0,0

Front skid is just modified in DeployAngle

Am i right ?

Link to comment
Share on other sites

I\'m not sure what you mean by Gemini skids? Is that a mod someone made?

But, if a part is attaching radially like the default leg, then you don\'t usually make more than one leg or whatever. The pivotaxis is only relative to the part\'s own origin center, and not related to which side of a ship the part connects to. So if you place the example leg in 4x symmetry, each time it attaches with its own internal X axis facing the ship, which means internally the Z axis (green) is the one passing through the hinge.

That\'s the reason its set up this way, so that we don\'t worry about the parts location; the game rotates the whole part as needed to connect, and we only worry about how it behaves in its 'internal' orientation

Link to comment
Share on other sites

This is gemini paraglider :

Originally Gemini wasn\'t intended to splashdown, but to deploy a parasail and glide to the ground. It would have used skids to land, like in the picture below. That\'s why gemini hadn\'t an LES tower but ejection seat, that could be used while gliding. However, project has been abandoned.

Link to comment
Share on other sites

Well, it looks like you could use the same leg part for the left and right one, since it will attach facing \'inward' on both sides of the capsule.

Looks like you\'d need a different leg for the nose, since it attaches at a different angle

Link to comment
Share on other sites

I had been kinda wondering about how the landing legs handled collision meshes. I\'m quite happy to hear that they\'re done as a hinge and a leg, since that means that legs that fold in underneath like those on the Apollo LEM are well within the realm of possibility.

Link to comment
Share on other sites

  • 2 weeks later...

Minor necro/threadjack, but:

I\'ve noticed that changing the .cfg in the vanilla leg such that

pivotingAngle = 90

yields a leg that still deploys to the same 45 degree angle below the horizontal, but with a different starting position (+45). Is there a quick-and-dirty method for setting the final position of the leg, rather than the initial? Or do I need to change the model itself such that the final position is at the horizontal (or whatever desired angle) rather than -45?

Link to comment
Share on other sites

Just a quick question regarding orientation - I\'ve never edited cfgs before, & I\'m trying to get my head around the orientation of a piece.

I\'d like to make basically a reversed lander leg - one that is pointing downwards when closed, & opens upward 135 degrees, basically the default leg rotated around 180 degrees planar to the surface it attaches to. I can\'t edit the angY in the file enough to get it 180 degrees around, the most it will go is 90, no matter what number I put in there. Any ideas as to whether it\'s possible without editing the 3d model?

Cheers. :)

Link to comment
Share on other sites

I\'ve been playing around with landing legs recently on a personal project. I found out a few things about landing leg params:

negative angle ranges don\'t crash the game or anything but it does bug out. The landing legs start out open, then you hit G once and they stay the same, the next time they flash closed, then open etc.

Sign of the rotation axis does make a difference it seems. When set to 0,0,1 fromt he standard 0,0,-1 the angle was negated, right now I\'m trying to figure out how to make a leg deploy up/rotate in the opposite direction but my testing so far doesn\'t seem to indicate negating the vector will do it.

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...