Crystal Space
9054 Posts in 2047 Topics by 74754 Members
Latest Member: Tuckerajibol526
 Pages: [1]
 Author Topic: iPcActorMove and Acceleration  (Read 2284 times)
Chris
Newbie

Posts: 6

 « on: December 30, 2007, 11:21:22 am »

Hello Everyone,

I am using Crystal Space and CEL for a simulation(http://www.crystalspace3d.org/forum/index.php/topic,1490.0.html). Since I need the simulation time to be independent of real time, I adjusted the Virtual Clock for my needs, so that with every Advance the clock advances exactly 10ms.

But now I have run into a problem. I am using a CEL Player Entity for my robot. I used PcActorMove to move my robot around. I change the speed depending on an algorithm and I have my own calculations to restrict the robots acceleration. But now I noticed that PcActorMove restricts acceleration. I can't just punch in a velocity of 1.0 and the robot immediatly moves at 1.0 speed, but it slowly accelerates.

I am using the Coordinates of the camera to determine where my robot is [pccamera->GetCamera()->GetTransform().GetOrigin()]. So maybe just the camera is accelerating slower and I can get the correct Coordinates somewhere else?

I am not sure I could properly explain the situation, so I will give an example what the desired effect is: I do
Code:
pcactormove->SetMovementSpeed(1.0f);
pcactormove->Forward(true);

Then I let the simulation run for exactly 1 (simulated) second, I want the change in position of the robot (and the robot camera) to be exactly 1.0 distance units away from the starting point. Is there any way to achieve that? Where is the restriction of the acceleration located?

Regards,
Chris
 Logged
Darek
Newbie

Posts: 48

 « Reply #1 on: December 30, 2007, 10:59:24 pm »

Camera always has spring and always follows the actor smoothly (except first person mode in the newcamera).
Use robot's pcmesh to get correct information.

About acceleration - I don't remebmer how actormove is made internally, but there is no acceleration control it's hardcoded (if exists) because it's specific for games. You cna always control everything via CS. Check the CS API.
 Logged
 Pages: [1]