You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thanks for making this mod open source. I found a peculiar line while porting the code from new movement physics into my mod.
elseif(!vectorMovement) {
targRot = quaterniond_fromVecToVec(vec3d_front(), dest - obj.position, vec3d_up());
// Added code to apply a little bit of thrust even when not rotated.
{
double dot = targRot.dot(obj.rotation);if(dot <0.999) {
if(dot <-1.0)
dot =-1.0;
}
else {
if(dot >1.0)
dot =1.0;
}
// dot is now in the range -1 to +1, where 0 is a rightangle between target rotation and current rotation.// Therefore, if we take 35% of the acceleration and multiply that by the absolute value of dot// we'll achieve the goal of slight off-axis acceleration, scaling up to 35% when it's almost parallel, and then the// normal code will take over when rotating is false or vector movement is true, as this entire block is only executed as// an else to the standard rotation/accel block.
double absdot = dot <0?0-dot : dot;
double ratio= absdot * offAxisThrustMultiplier;// 35% thrust scaled down to zero sideways.
double timeLeft =time;do {
double take =0;obj.acceleration = accToGoal(a, take, dest -obj.position, destVel -obj.velocity) *ratio;
take =min(timeLeft, max(take, 0.01));obj.position+=obj.acceleration * (take * take *0.5);obj.velocity +=obj.acceleration * take;
timeLeft -= take;
} while(timeLeft >0.0001);
}
}
this snippet in the Mover component, specifically
obj.acceleration = accToGoal(a, take, dest -obj.position, destVel -obj.velocity) *ratio;
my understanding is accToGoal uses the a argument given to it to determine which way to accelerate, so shouldn't this line be applying the lateral thrust ratio to the a given to it, rather than applying it to the new acceleration accToGoal is computing based on 100% acceleration?
obj.acceleration = accToGoal(a*ratio, take, dest -obj.position, destVel -obj.velocity);
The text was updated successfully, but these errors were encountered:
Hi
First of all, thanks for making this mod open source. I found a peculiar line while porting the code from new movement physics into my mod.
this snippet in the Mover component, specifically
my understanding is
accToGoal
uses thea
argument given to it to determine which way to accelerate, so shouldn't this line be applying the lateral thrust ratio to thea
given to it, rather than applying it to the new accelerationaccToGoal
is computing based on 100% acceleration?The text was updated successfully, but these errors were encountered: