Show Posts
|
|
Pages: 1 2 [3] 4
|
|
32
|
Crystal Space Development / Support / Strange occurence with move callbacks
|
on: February 15, 2006, 06:31:17 pm
|
|
I have set up a move callback class in a similar way to the collision callback class i defined before. My class looks like this:
#include "car_move_callback.h"
SCF_IMPLEMENT_IBASE(Car_Move_Callback); SCF_IMPLEMENTS_INTERFACE (iDynamicsMoveCallback); SCF_IMPLEMENT_IBASE_END;
void Car_Move_Callback::Execute (iMeshWrapper* mesh, csOrthoTransform& t) { csPrintf("Car moved!"); }
void Car_Move_Callback::Execute (iLight* light, csOrthoTransform& t) { }
void Car_Move_Callback::Execute (iCamera* camera, csOrthoTransform& t) { }
void Car_Move_Callback::Execute (csOrthoTransform& t) { }
However, when I set the move callback to the car's iRigidBody, upon starting the application, the car gets placed at a strange location stuck in the wall of the room, rather than its usual place. When I comment out the code to set the move callback, the car is positioned as normal. This is the code with the move callback set commented out.
iDynamicsCollisionCallback* ccb = &collCallback; //iDynamicsMoveCallback* mcb = &moveCallback; car->SetCollisionCallback(ccb); //car->SetMoveCallback(mcb); car->Update();
Any idea as to what is happeneing here?
regards, Kate
|
|
|
|
|
33
|
Crystal Space Development / Support / Game controller support
|
on: February 15, 2006, 05:39:43 pm
|
|
Hi there,
Would crystal space be able to support arbitrary game controllers as input devices? In particular I am thinking of using steering wheels and pedal controllers to control the cars in my game.
regards, Kate
|
|
|
|
|
34
|
Crystal Space Development / Support / Networking/muliplayer support
|
on: February 15, 2006, 05:37:47 pm
|
|
Hi there,
Could you give me any advice on networking a crystal space game? Ive heard theres something called VOS plugin for crystal space, and Raknet. I'd like to know the best way to go with it, if anyone has done it before.
If networking isnt possible, I know it is possible to have multiple game views with separate cameras. Would it be possible to place each view on a separate monitor, assuming I have a pc with multiple monitors attached. The game could then be played as multiplayer, but on a single machine.
regards, Kate
|
|
|
|
|
35
|
Crystal Space Development / Support / Re: Collision callbacks
|
on: February 15, 2006, 05:08:21 pm
|
|
Hi, I have successfully implemented the collision callback. However, it seems to be being called continously. I assume this is because my car is resting on the ground? If so, can I make the collision call back execute only if the car hits something other than the floor?
regards, Kate Mallichan
|
|
|
|
|
37
|
Crystal Space Development / Support / Re: Collision callbacks
|
on: February 13, 2006, 01:37:03 pm
|
|
Looking in ivaria/dynamics.h i see this:
struct iDynamicsCollisionCallback : public iBase { virtual void Execute (iRigidBody *thisbody, iRigidBody *otherbody) = 0; };
thus my call back function in the implementing class must be called Execute, and should be supplied pointers to two iRigidBodys to check for collisions between. Is this correct?
thankyou for your help, Kate
|
|
|
|
|
38
|
Crystal Space Development / Support / Collision callbacks
|
on: February 13, 2006, 12:59:24 pm
|
|
Hi there,
I would like to implement some collision actions (particle effects and sounds) when my car collides with other objects in game. I am not sure how to go about making crystal space execute these actions automatically when a collision is detected.
I have seen the method:
RigidBody::SetCollisionCallback ( iDynamicsCollisionCallback * cb )
in the API but i am unsure how to use this. In particular i am unsure what the iDynamicsCollisionCallback is. should this be some kind of function pointer to the collision actions i want to execute?
regards
Kate Mallichan
|
|
|
|
|
39
|
Crystal Space Development / Support / Re: using AddForce()
|
on: February 07, 2006, 06:27:38 pm
|
thankyou. I am now using a larger force and making it apply as long as the key is pressed, to simulate pressing the car accelerator. Part of the problem before was also that I had set the density of the car's collider box too high  Kate
|
|
|
|
|
41
|
Crystal Space Development / Support / Re: using AddForce()
|
on: February 07, 2006, 03:57:39 pm
|
|
Sory about previous post, submitted before i finished writing!
Hi there,
I am using ode, with the following code to try to move my car. car is an iRigidBody. The car renders fine in the level, but wont move when CSKEY_RIGHT is pressed. Im not sure if the problem is here or not. Am i using AddForce correctly in the following code?
if (kbd->GetKeyState (CSKEY_RIGHT)) { car->AddForce(CS_VEC_RIGHT * 4 * speed); car->Update(); }
regards, Kate Mallichan
|
|
|
|
|
44
|
Crystal Space Development / Support / problem with some bbox code?
|
on: February 03, 2006, 02:39:41 pm
|
|
I think the following code may be the cause of a seg fault.
Particularly the lines:
csBox3 bbox1 = wing1mesh->GetWorldBoundingBox(); csBox3* bbox1ptr = &bbox1; csVector3 size1 = bbox1ptr->GetSize();
which i am unsure of. Could you shed any light on this ? The rest of the surrounding code is below:
const csMatrix3 tmm ; const csVector3 tvv (0); csOrthoTransform tt (tmm, tvv); iMeshFactoryWrapper* wing1factory = engine->FindMeshFactory("thingpolySurface8"); csRef<iMeshWrapper> wing1mesh = engine->CreateMeshWrapper(wing1factory,"wing1",room,csVector3 (0, 0, 0)); csRef<iRigidBody> wing1meshbody = dynSys->CreateBody(); wing1meshbody->SetProperties (1, csVector3 (0), csMatrix3 ()); wing1meshbody->AttachMesh (wing1mesh); wing1mesh->GetMovable()->UpdateMove(); csBox3 bbox1 = wing1mesh->GetWorldBoundingBox(); csBox3* bbox1ptr = &bbox1; csVector3 size1 = bbox1ptr->GetSize(); wing1meshbody->AttachColliderBox (size1,tt, 10, 1, 0.8f);
much appreciated Kate Mallichan
|
|
|
|
|
|