Crystal Space
Welcome, Guest. Please login or register.
April 23, 2014, 09:05:52 pm

Login with username, password and session length
Search:     Advanced search
8990 Posts in 2037 Topics by 7618 Members
Latest Member: Tymqwaro
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  iPcActorMove and Acceleration
« previous next »
Pages: [1] Print
Author Topic: iPcActorMove and Acceleration  (Read 1748 times)
Chris
Newbie
*
Posts: 6


View Profile Email
« 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



View Profile
« 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] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 5.182 seconds with 15 queries.