trueaxis.com Forum Index trueaxis.com
True Axis Physics SDK Forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

A little confused about where to start
Goto page 1, 2  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    trueaxis.com Forum Index -> Getting Started
View previous topic :: View next topic  
Author Message
lingu023



Joined: 11 Feb 2007
Posts: 12

PostPosted: Wed Feb 28, 2007 4:31 pm    Post subject: A little confused about where to start Reply with quote

I've been planning on using this library to make a simple racing game. I choose it because the democars plugin to the demos seemed to look good and looking at the code it seems like pretty straight forward implementation.

However I keep feeling a bit lost about which end to start with. I know what I want, but not exactly what is needed for it.

I want a simple flat ground to place the car on, and of course the car, with camera movement following the car and the car reacting to keyboard.

I've looked through most of the posts in this part of the forum, but it seems like I'm slightly more unused to programming than others since I didn't seem many others having problems starting.

Here are some of the things I wonder about:

1) Do you use TA combined with OpenGL for doing graphics and handling camera, or do TA handle all of this on its own? I used some OpenGL last year so I'm a little more used to that.

2) I think I read that you include the corresponding vcproj file when compiling with Visual Studio. Is that enough or do you have to do something more to get it to work? I'm not very good at the settings in the project properties. (But I've managed to get things working before with other DLL products. But I think this time I'm trying without DLLs for TA)

3) There is a SimplePhysicsSimulationExample.cpp example in the help file and I'm wondering if it is ready for compilation, or how much that are left out for because it is "obvious" what to write when finishing the example.
For example:

// Caculate value for fDt
//.

That part confuse me a bit. Is it something you need to do, or just something you could do? fDt seems important for the timestep but maybe that single fDt row above giving it a value is the normal way of using it?

// Do game logic and render the scene
//.

This sort of goes hand in hand with question 1). Do I render it with OpenGL best, or is there render functions in TA that might just as well be used? Do I see anything if I use this example code without adding some of my own code here?

// Use pDynamicObject->GetFrame() to render
// the dynamic object.
//.

This also feels like above. Does TA render the objects with that function? Can I texture them or do I then need to go to OpenGL? Do OpenGL and TA mix well?

4) I've been looking at the democars source code and while many things look good, there is just too much code to really understand everything. There doesn't happen to be a somewhat slimmed down version that I could look at? It is hard to tell exactly what is going on with the actual graphics, camera and keyboard interaction. I get the impression it uses windows coding for it? (from the include windows.h)


I think that was most of my questions, and I hope you'll be able to answer them. Some might have gotten a bit repetative.

My current assumption of how to mix something together is sort of using a simple OpenGL code for opening a window, toss in the simplephysics example to have ground and a box falling down, and possibly using the cartemplate example to put a car in there. I'm just worried the examples might leave something important out that I'm too dumb to think of. Also worried about if objects will be drawn or be invisible.
Of course I'm also worried about keyboard since I think I remember glut being very poor at it.
Back to top
View user's profile Send private message
beebs1



Joined: 21 Feb 2007
Posts: 6

PostPosted: Sat Mar 03, 2007 4:25 pm    Post subject: Re: A little confused about where to start Reply with quote

lingu023 wrote:

1) Do you use TA combined with OpenGL for doing graphics and handling camera, or do TA handle all of this on its own? I used some OpenGL last year so I'm a little more used to that.


I believe TA has some basic drawing capabilities for debugging purposes, but for what you are describing you'll need an API such as OpenGL or DirectX. Use whichever you prefer, really.

lingu023 wrote:

2) I think I read that you include the corresponding vcproj file when compiling with Visual Studio. Is that enough or do you have to do something more to get it to work?


The DLL version of TA is experimental, so I'd personally recommend you use the static libraries. First you need to set the search paths - I don't know what compiler you are using, but with MSVC goto Tools->Options->Projects and Solutions->VC++ Directories. Then #include the necessary files in your source code, and use #pragma to link with the libraries.

lingu023 wrote:

3) There is a SimplePhysicsSimulationExample.cpp example in the help file and I'm wondering if it is ready for compilation


The example you mention is a 'framework' for using TA, i.e. it contains no drawing code or logic other than physics.

lingu023 wrote:

// Caculate value for fDt
//.

That part confuse me a bit.


fDt is the time that has elapsed since the last frame. You call Update() once every frame and tell it how much time has passed so that TA can correctly calculate where everything should be, what has collided, etc. The example is designed to update the simulation 60 times every second, but you'll probably want to calculate the actual amount of time which has passed. Otherwise, you could put the physics update on a seperate thread which updates is 60 times per second regardless of framerate, but that will quickly get complex.

lingu023 wrote:

// Do game logic and render the scene
//.

This sort of goes hand in hand with question 1).


As question 1. You don't see anything if you compile the example as it is (indeed, if it even compiles).

lingu023 wrote:

// Use pDynamicObject->GetFrame() to render
// the dynamic object.
//.

Does TA render the objects with that function? Can I texture them or do I then need to go to OpenGL? Do OpenGL and TA mix well?


That function gets the dynamic object's 'frame' - information about it's position, which way it is facing, etc. It does not draw anything, but you use this information to draw the object in OpenGL.

lingu023 wrote:

4) There doesn't happen to be a somewhat slimmed down version that I could look at?

There isn't really. An application that allows you to race cars around a track using an accurate physics simulation is inherently quite complex, and the example is fairly bare-bones as it is to just demo how to get it working. I suggest you start with a floor and some balls bouncing on it, and keep adding and improving until you understand how it all works.

Wow, I feel like I just finished a marathon Smile I hope that was helpful, if you have any more questions just post them here.
Back to top
View user's profile Send private message
lingu023



Joined: 11 Feb 2007
Posts: 12

PostPosted: Mon Mar 05, 2007 1:43 pm    Post subject: Reply with quote

I've finally managed to start doing something, and stop sitting around thinking.

Right now I'm having a bit of linking errors.

I'm attempting to make a class just to make it look more organized in the code. So instead of pasting it all into the code, I'm planning on making an object and call functions that do things for me.

The class look something like this right now (to run the the example)

Code:

#ifndef PHYSICCALLS_H
#define PHYSICCALLS_H

#include "TA/Physics/Physics.h"
#include "TA/Physics/DynamicObject.h"
#include "TA/Physics/StaticObject.h"
#include "TA/Physics/CollisionObjectAABBMesh.h"

#include "Constants.cpp"   // File of constants

class PhysicCalls {

public:
   void CreatePhysicsWorld();
   void RunPhysicsWorld();
   void EndPhysicsWorld();
private:
   TA::Physics& physics;// = TA::Physics::GetInstance();   
   TA::AABB aabb;
   TA::DynamicObject* pDynamicObject;// = TA::DynamicObject::CreateNew();
   TA::StaticObject* pStaticObject;// = TA::StaticObject::CreateNew();
   TA::CollisionObjectAABBMesh* pStaticCollisionObject;// = TA::CollisionObjectAABBMesh::CreateNew();

};
#endif //PHYSICCALLS_H


Incase you wonder about the cpp, I'll include it too:

Code:

#include "PhysicCalls.h"

void PhysicCalls::CreatePhysicsWorld()
{
   //---------------------------------------------------------------------------------
    // Initialise physics.
    //---------------------------------------------------------------------------------
    TA::Physics::CreateInstance();

**And the example code copied until**

// Add the static object to the simulation.
    physics.AddStaticObject(pStaticObject);
    pStaticObject->Release(); // We no long need the reference.
    pStaticObject = 0;


}

void PhysicCalls::RunPhysicsWorld()
{
   // Update the simulation
    physics.Update(fDt);

}

void PhysicCalls::EndPhysicsWorld()
{
   //---------------------------------------------------------------------------------
    // Finalise physics.
    //---------------------------------------------------------------------------------
    TA::Physics::DestroyInstance();

    pDynamicObject->Release();
    pDynamicObject = 0;

}


And I get a lot of linking errors like this:

PhysicCalls.obj : error LNK2019: unresolved external symbol
"public: void __thiscall TA::Physics::AddStaticObject(class TA::StaticObject *)"
(?AddStaticObject@Physics@TA@@QAEXPAVStaticObject@2@@Z)
referenced in function "public: void __thiscall PhysicCalls::CreatePhysicsWorld(void)"
(?CreatePhysicsWorld@PhysicCalls@@QAEXXZ)

About 20, for different parts of the code.

It is hopefully something simple I've missed, but I'm not sure what. I've included the vcproj for 7 and am using visual studio .NET 2003.

Maybe I also should mention just the included TA folder, and not the actual library from TADII.



Decided to move on a bit while thinking about the linking solution, and stumbled on a new problem.

I include the example code for the car template use in a new function, CreateCar(), but then it keeps saying that CarTemplate is not a member of TA.

error C2039: 'CarTemplate' : is not a member of 'TA'

and the line it complains on is this part:

Code:
private:
   TA::Physics& physics;// = TA::Physics::GetInstance();   
   TA::AABB aabb;
   TA::DynamicObject* pDynamicObject;// = TA::DynamicObject::CreateNew();
   TA::StaticObject* pStaticObject;// = TA::StaticObject::CreateNew();
   TA::CollisionObjectAABBMesh* pStaticCollisionObject;// = TA::CollisionObjectAABBMesh::CreateNew();
   TA::CarTemplate* pCarTemplate;
   TA::CollisionObjectConvex* pCollisionObjectConvex;


Any suggestions for this one? I mean the manual/helpfile says there is a TA::CarTemplate, and the .h files have a CarTemplate.



Ignore the cartemplate part. Did the extremely dumb mistake of forgetting includes. sigh.
Back to top
View user's profile Send private message
lingu023



Joined: 11 Feb 2007
Posts: 12

PostPosted: Tue Mar 06, 2007 9:45 pm    Post subject: Reply with quote

After some trial and error I seem to have solved the linking thing.

I added "additional library path" to the TA/Project/Debug folder and added the lib file I think is created there from the TA_VC7.vcproj file to "additional dependencies". After that I built the whole solution and not just my code. Together it worked, not sure if I could have done only parts of this and still get it to work.
Back to top
View user's profile Send private message
lingu023



Joined: 11 Feb 2007
Posts: 12

PostPosted: Thu Mar 08, 2007 9:59 pm    Post subject: Reply with quote

Naturally I got a new problem now.

I'm having trouble getting the debug render function to work correctly. I'm not certain if I'm missing something in TA or if I missed something in OpenGL.

Code:
void PhysicCalls::RunPhysicsWorld()
{
   // Update the simulation
    physics.Update(fDt);

   // Do game logic and render the scene
   // Render collision objects
    physics.Render();

    // Use pDynamicObject->GetFrame() to render
    // the dynamic object.
    //.
    //.
    //.


}


And

Code:
// Draw The Scene.  Watch For ESC Key And Quit Messages From DrawGLScene()
         if (active)                        // Program Active?
         {
            if (keys[VK_ESCAPE])            // Was ESC Pressed?
            {
               done=TRUE;                  // ESC Signalled A Quit
            }
            else                        // Not Time To Quit, Update Screen
            {
               DrawGLScene();               // Draw The Scene
               gamephysics.RunPhysicsWorld();  // Do the physic calculations and renderings
               SwapBuffers(hDC);            // Swap Buffers (Double Buffering)
            }
         }


and

Code:
int DrawGLScene(GLvoid)                           // Here's Where We Do All The Drawing
{
   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);   // Clear Screen And Depth Buffer
   glLoadIdentity();                           // Reset The Current Modelview Matrix
   return TRUE;                              // Everything Went OK
}


All I know is that I'm getting a dark cleared screen which seem to be empty. I'm suspecting either
1) Camera for some reason is pointing a dumb direction (haven't changed anything really with that)
2) I'm clearing screen after drawing, in other words, wrong order.
3) Missing some info for TA to know how or what to render.
Back to top
View user's profile Send private message
luke
Site Admin


Joined: 15 Oct 2004
Posts: 621

PostPosted: Tue Mar 13, 2007 10:35 am    Post subject: Reply with quote

you need to take a look at the physicsrender class.

There is also some code that uses this in the demos if you want to download the source code and take a look.
Back to top
View user's profile Send private message Send e-mail
lingu023



Joined: 11 Feb 2007
Posts: 12

PostPosted: Tue Mar 13, 2007 7:03 pm    Post subject: Reply with quote

The physicsrender class is a bit confusing for me.

I assume you are supposed to somehow tell the class that when it gets a call "renderline" to use, in my case, the OpenGL render line code. But I'm just not seeing how that actual linking is done.

Am I supposed to go into the physicsrender file and replace some code for OpenGL rendering code? I.e. expand this part of the file PhysicsRender.h:

Code:
typedef void (TAC_CALL *RenderLineCallBack)(const Vec3& v3PosA, const Vec3& v3PosB, u32 nColour);
   typedef void (TAC_CALL *RenderArrowCallBack)(const Vec3& v3Pos, const Vec3& v3Vector, u32 nColour);
   typedef void (TAC_CALL *RenderPolygonCallBack)(int nNumVertices, const Vec3* pv3VertexList, const Vec3* pv3NormalList);


I'm just more used to there being a .h and a .cpp file, and the actual function code part going into the .cpp and not the .h.

I think to make a line in OpenGL it probably is something like:

Code:
glBegin(GL_LINE);
glVertex3f(0.0f, 1.0f, 0.0f);
glVertex3f(1.0f, 1.0f, 0.0f);
glEnd();


So I feel like I have all the puzzle pieces, just not a good idea of what the result should be. Some directions would probably help a lot.

Do I perhaps make my own function mydrawline(const Vec3 &v3PosA, const Vec3 &v3PosB, u32 nColour) which does the line drawing in OpenGL and link it to the PhysicsRender.h with SetRenderLineCallBack(mydrawline(const Vec3 &v3PosA, const Vec3 &v3PosB, u32 nColour))?

The demos (mostly looking at DemoStackingObjects) doesn't seem to be that clear to me what to do.





I had this other idea while I couldn't understand how to use the renderphysics funktions, and that was to just manually draw some objects of the same sizes in OpenGL and then just make them share positions with the actual collisionobjects.

I know dynamicobjects have the information const vec3 GetPosition(), which I assume I could read every frame update and update my OpenGL objects with. My problem is that I'm not sure how to access the objects in the best way.

Do I need to manually store some kind of list of dynamic objects so I can step through it and check each dynamic object's position? Or is there already a similar list structure somewhere in one of the other classes that I should use?



Would be helpful with a little more info on those two approaches to see the physics in action.
Back to top
View user's profile Send private message
lingu023



Joined: 11 Feb 2007
Posts: 12

PostPosted: Wed Mar 14, 2007 8:36 pm    Post subject: Reply with quote

It seems like trial and error is a slow but steady way forward.

Currently I can manage to draw ground, and 2 objects, which I let fall down. The problem right now is that the second object seem to go half-through the first object, which stops correctly when hitting the ground.

I guess I'll have to look through the collision codes a bit more to see what is different between static + dynamic collisions and dynamic + dynamic collisions.

Also I haven't added any actual rotation to the objects yet, if that might be the reason they pass slightly through eachother.


Edit: Found the error on collision, which infact was just an error in my drawing of the graphics. (missed a glPopMatrix and glPushMatrix).

Still not sure on how to get orientation on the objects. I tried some from the "GetAngularVelocity", but it wasn't very healthy when it was 0. Giving the MFrame's m33Rotation a try. Just need to remember how to use rotation matrices.
Back to top
View user's profile Send private message
lingu023



Joined: 11 Feb 2007
Posts: 12

PostPosted: Sun Mar 18, 2007 10:19 pm    Post subject: Reply with quote

I'm almost done with understanding the connection between the physics and my opengl (well for the basics).

I'm just having some trouble finding exactly what I'm doing wrong with my car.

Code:
//---------------------------------------------------------------------------------
   // Car Template Example
   //---------------------------------------------------------------------------------
   
   pCarTemplate = TA::CarTemplate::CreateNew();

   // We need to call BeginInitialise before we start setting the car templates properties.
   pCarTemplate->BeginInitialise();

   // Add an collision object ot the car template.
   pCollisionObjectConvex = TA::CollisionObjectConvex::CreateNew();
   pCollisionObjectConvex->InitialiseAsABox(TA::AABB(TA::Vec3(0.0f, 0.0f, 0.0f), TA::Vec3(1.2f, 0.6f, 2.0f)));
   pCarTemplate->AddCollisionObject(pCollisionObjectConvex);
   pCollisionObjectConvex->Release();
   
   // Add wheels to the car template.
   const float k_fWheelRadius = 0.3f;
   const float k_fWheelWidth = 1.1f;
   const float k_fWheelTop = 0.0f;
   const float k_fWheelBottom = -1.0f;
   const float k_fWheelFront = 1.5f;
   const float k_fWheelBack = -1.5f;
   TA::CarTemplate::Wheel wheel;

   // Front wheels
   wheel.SetSuspensionTop(TA::Vec3(k_fWheelWidth, k_fWheelTop, k_fWheelFront));
   wheel.SetSuspensionBottom(TA::Vec3(k_fWheelWidth, k_fWheelBottom, k_fWheelFront));
   wheel.SetRadius(k_fWheelRadius);
   wheel.SetSteeringFlag(true);
   wheel.SetDrivingFlag(false);
   wheel.SetHandBrakeFlag(false);
   // Set the slip curves for the wheel.
   // These are actually the same as the default values so the following 2 lines are unnecessary.
   //wheel.SetSlipAngleToLateralForceCallBack(SlipAngleToLateralForce);
   //wheel.SetSlipRatioToNormalisedTractionCallBack(SlipRatioToNormalisedTraction);
   pCarTemplate->AddWheel(wheel);

   wheel.SetSuspensionTop(TA::Vec3(-k_fWheelWidth, k_fWheelTop, k_fWheelFront));
   wheel.SetSuspensionBottom(TA::Vec3(-k_fWheelWidth, k_fWheelBottom, k_fWheelFront));
   wheel.SetRadius(k_fWheelRadius);
   wheel.SetSteeringFlag(true);
   wheel.SetDrivingFlag(false);
   wheel.SetHandBrakeFlag(false);
   pCarTemplate->AddWheel(wheel);

   // Rear wheels
   wheel.SetSuspensionTop(TA::Vec3(k_fWheelWidth, k_fWheelTop, k_fWheelBack));
   wheel.SetSuspensionBottom(TA::Vec3(k_fWheelWidth, k_fWheelBottom, k_fWheelBack));
   wheel.SetRadius(k_fWheelRadius);
   wheel.SetSteeringFlag(false);
   wheel.SetDrivingFlag(true);
   wheel.SetHandBrakeFlag(true);
   pCarTemplate->AddWheel(wheel);

   wheel.SetSuspensionTop(TA::Vec3(-k_fWheelWidth, k_fWheelTop, k_fWheelBack));
   wheel.SetSuspensionBottom(TA::Vec3(-k_fWheelWidth, k_fWheelBottom, k_fWheelBack));
   wheel.SetRadius(k_fWheelRadius);
   wheel.SetSteeringFlag(false);
   wheel.SetDrivingFlag(true);
   wheel.SetHandBrakeFlag(true);
   pCarTemplate->AddWheel(wheel);

   // Other properties.
   pCarTemplate->SetMass(1500.0f);
   pCarTemplate->SetTorqueMultiplier(5.0f);
   pCarTemplate->SetDownForce(4.0f);

   // We need to call EndInitialise when we have finished setting the car template properties.
   pCarTemplate->EndInitialise();

   /********************************
   * Start the real car
   *********************************/

   pDCarObject = TA::DynamicObjectCar::CreateNew();
   pDCarObject->Initialise(pCarTemplate);


   // Place the dynamic object
        pDCarObject->SetPosition(TA::Vec3(-2.0f, 2.0f, 0.0f));

   pDCarObjectList.push_back(pDCarObject);
   //physics.AddDynamicObject(pDCarObject);


As soon as I uncomment the last part with adding it to the physics engine I get the program to crash on start-up. If I leave it out, I manage to draw the car collision box at the right place, but it has no gravity (since not added to the physics)

Any ideas on what I'm missing? It has to be some field I forget to fill out, or something I use the wrong way. I looked at the example code for democars and the only difference I can spot is that they use a list differently (for keeping track) and they seem to use a reference instead of pointer at some part.
Back to top
View user's profile Send private message
luke
Site Admin


Joined: 15 Oct 2004
Posts: 621

PostPosted: Mon Mar 26, 2007 10:30 am    Post subject: Reply with quote

I can't see anything obviously wrong. I think I would have to know exactly where the crash happens to help. The only thing I can think of is, have you called Physics::CreateInstance before adding the car.
Back to top
View user's profile Send private message Send e-mail
lingu023



Joined: 11 Feb 2007
Posts: 12

PostPosted: Wed Mar 28, 2007 5:04 pm    Post subject: Reply with quote

I thought I'd recheck exactly what the problem was so I uncommented the last line:

Code:
//physics.AddDynamicObject(pDCarObject);


And for some reason it didn't crash. So not really knowing how I fixed it I thought I'd keep working now that the problem was gone. But then I managed to crash the application again.

This time the line I comment and uncomment between working and not working is the placement of the car. Either with:

Code:
pCollisionObjectConvex->InitialiseAsABox(TA::AABB(TA::Vec3(0.0f, 0.0f, 0.0f), TA::Vec3(10.5f, 4.0f, 23.0f)));

or
Code:
pDCarObject->SetPosition(TA::Vec3(-2.0f, 2.0f, 0.0f));



Some further testing seem to say that I can have "any" value in the position, aslong as it doesn't end up "inside" the bounding box for the world. (MAP_SIZE = 1024)

Code:
aabb.Initialise(TA::Vec3(MAP_SIZE/2, 0.0, MAP_SIZE/2),
                TA::Vec3(MAP_SIZE/2, MAP_SIZE/2, MAP_SIZE/2));
    physics.SetWorldDimensions(aabb);


Making it reach from about (0.0,-512.0,0.0) to (1024.0,512.0,1024.0) as a square.

Setting the position of the car to (-1,-1,-1) works, or (1200,1200,1200) works, aslong as it is outside the world. Inside it crashes.

Doing a simple debug on the crash just gives you the info that the problem happened in file zpta019.cpp on row 2726, but those files doesn't say anything to me since they look quite binary.
Callstack says:
Code:
>   CarApp.exe!TA::DynamicObjectCar::Update(float lOOlllOOllll=0.016666668)  Line 2726 + 0x15   C++
    CarApp.exe!TA::Physics::lOllOllOlOOO(float lOOlllOOllll=0.016666668)  Line 9458   C++
    CarApp.exe!TA::Physics::Update(float lOOlllOOllll=0.016666668)  Line 2736   C++


Does that tell you anything?
Back to top
View user's profile Send private message
lingu023



Joined: 11 Feb 2007
Posts: 12

PostPosted: Sat Mar 31, 2007 3:21 pm    Post subject: Reply with quote

I don't know how, but I managed to get it to work now.

Only thing I know I did differently was adding more things to the code that I would be using in the future. My guess is that the following part is very much needed:

Code:
               //Update car
               gamephysics.CarUpdate(0,
                  Steering,
                  Acceleration,
                  Brake,
                  HandBrake,
                  SteeringHelp,
                  TractionControl,
                  Gear);


Which I give a lot of default values if nothing is pressed, and some special values if "driving" keys are pressed.

So I guess before I added this it for some reason had no idea what values to update with (I just assumed it would give default values for not moving at all) so it crashed at every update call.

Now that I got it running it seems like my keys don't do anything, but hopefully making the car move will be easier than figuring out why it crashed.

Edit: Incase anyone wonder the 0 is index for a car list, and the other values are the ones the function UpdateControls() wants.
Back to top
View user's profile Send private message
lingu023



Joined: 11 Feb 2007
Posts: 12

PostPosted: Sat Mar 31, 2007 5:20 pm    Post subject: Reply with quote

Since this is my big question thread I might aswell continue with my observations and questions.

I have this 16*16 grid system for a terrain, and it worked fine from the beginning, but then I started to try and make smaller objects but it seems like if they are "too small" they fall through. Seem to be somewhat risky around 4*4*4 boxes. I'll just use big enough to be safe boxes to avoid the problem, but could be interesting to hear why it acts like this.
Back to top
View user's profile Send private message
lingu023



Joined: 11 Feb 2007
Posts: 12

PostPosted: Tue Apr 03, 2007 2:12 pm    Post subject: Reply with quote

So I now have a decently working car in a decently working world.

I'm having a bit of an issue with the camera use though. I try to use
Code:
const Vec3 & TA::DynamicObjectCar::GetForward (    ) const [inline]

to set which spot my camera is positioned to always have it behind the car. However GetForward seem to never change when I turn. Is this a bug or am I not understanding how forward vectors work?

Since the work is due to the 10th a fast answer would be good. Going to have a look at if I can use either
Code:
const Vec3 & TA::DynamicObject::GetLinearVelocity (    ) const [inline] 
or
const MFrame & TA::DynamicObject::GetFrame (    ) const [inline] 

to determine which direction the car is heading and adjust the camera from that. I think the democars had a pretty good camera too so I'll take another look at that one, but it seemed like a lot of extra bonus functions compared to what I'm looking for.
Back to top
View user's profile Send private message
lingu023



Joined: 11 Feb 2007
Posts: 12

PostPosted: Wed Apr 04, 2007 3:17 pm    Post subject: Reply with quote

Saw the Frame was used in the demo so I decided to use it too, and it worked excellent as a forward vector (from the z-vector).

Was wondering though if it was possible to set the acceleration and max speed. Haven't spotted those settings and it would be nice with a bit more control.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    trueaxis.com Forum Index -> Getting Started All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group