Interesting problem to have

ok, I have a rig, he walks, TERRIBLY
I am making it so he uses a 60 frame walk cycle, but here is the catch, the walk is IK, so I can move the rigid bodies anywhere, per animation cycle,

so, I want to use a point … P1 to cast two rays Ray1 and Ray2 and use that to get two values per cast , local X(forward dist) and local Z, this will be used to get the rise over run and get the slope,

I need to use the collision spot of the rays Cast1 and Cast2 to define an arc that is the motion, for the next step,
and then divide it into a offset from the base walk, or replace the base walk with it,

how do I do an arc in python? how can I adjust the height of the “center” of the arc (Ie P1.5)
this seems like it could change the walk to a run by adjusting it and the angle of the cast of p2

I can do python now, I just don’t know how to attack this one, as I don’t know how to cast a ray from python, or how to trigger two rays at once with logic without it using two “casters” and it just seems very sloppy

You will need two ray casts because they have different purposes. One detects forward limit and one downward limit. Indeed you might be able to use the result of one ray.
To evaluate the hit positions (rays do not collide they are imaginary lines, the hit position is where the line crosses a face) you need Python.

How you calculate a curve should sound familar to what you learnt in school e.g. X^2. The x-axis is the time or frame the y axis is what you calculate. There are other options two but it all strongly depends on your setup.

I know this does not help much. I do not have a solution ready.

Monster

another side note, how do I change a vector into a rotation for the BGE?

I have

import bge
cont = bge.logic.getCurrentController()
own = cont.owner
X = own[“Health”]
rot = own.parent.getAxisVect()
rot.x=rot.x+X

so since I can’t find a own.setAxisVect()
what do I do to align own with the new rot?

alignAxisToVect

I thought, but I can’t get it to work…

A vector is no rotation. A vector is a direction and a length.

A game object has an orientation which consits of three vectors. These vectors represent the direction of the local x,y and z axis in the space of the scene (world) or the parent (local). Each vector is a normal to the others (means 90 degree to the others). All three vectors biuld the orientation matrix.

To let a game object face to a specified direction ( along a vector ) you need to define what you mean with “front”. So you need to tell alignAxisToVector which local axis should match the vector you provide. With this information the function can calculate and set an according rotation.

I hope it helps

[FONT=Verdana][COLOR=#000000]Is there a way to convert a vector rot to a matrixrot?

can you just code the last part?
obj.alignAxisToVect([1.0,0.0,0.0], 0, 1.0)
I just don’t get the usage, I know the func

Your example turns the game object obj in a way that its x axis (0) is directed along scenes x axis.

So, what I am saying, is how do I add to a rotation a value , like a property, in order to make a gauge?

so the higher X is, the more the object moves/rotates on one axis?

Ok I got it working with position, just having some issues with matrices of rotation, there is not an easy to use vector angle based movement?
I am used to
0-360 X,0-360 Y,0-360 Z

So I need to do this still…

own[“Health”]
own.localOrientation.z= own.parent.localOrintation.z+H

just don’t get it…

still working on moving an arc based on p1 and p2 and p 1.5

and the rot thing :slight_smile: