Colliding two Characters

Hello



I have a bit of a problem with the CharacterControl.

I have two Spatials with a CharacterControl attached and they won’t collide. Even when I create my own CollisionListener, I don’t get the collision of the two in the “collision” method. Is there any way to collide two CharacterControls? Would it help if I implement my own CharacterControl?



Any Pointers are very welcome.

http://burninghammer.ch/ihmscolliderihms.png


Here is a picture of my problem. The problem is, that no collision occures. It's not that they just don't bump.

are you attaching them to the physics space ? show us the code where you attach control

[java]

charControl = new CharacterControl(new CapsuleCollisionShape(2, 5f, 1), 0.05f);

representation.addControl(charControl);



addObject(sinbad);

addObject(redSinbad);



private void addObject(Representable rep) {

representables.add(rep);

bulletAppState.getPhysicsSpace().addAll(rep.getRepresentation());

rootNode.attachChild(rep.getRepresentation());

}





[/java]



It only happens with two CharacterControls, if I attach a RigidBodyControl to the red Sinbad, they collide. Is it because they are both kinematic? Can I override this somehow without breaking the whole Character behavior.

hmm, im not sure what Representables are, but are you doing Model/spatial.addControl(charControl) ?

i.e. sinbad.addControl(charControl)



btw i tihnk you need them to have seperate instances of control and then attach them, otherwise they may belong to same group (im probably wrong here)

Both are colliding with the terrain, so I think the Controls are attached correctly. You can also see the CollisionShapes.



representation.addControl(charControl); → representation is a Node with the Sinbad spatial in it. And yes, both Sinbads have their own representation.



The problem is that the two Charactercontrols don’t collide with each other. They collide perfectly with everything else than charactercontrols.

Hmm i just checked mine, i have a mainplayer, i quickly created a second identical one and added physics, they dont collide with each other, perhaps they also need rigidBody or ragdoll controls

lol found this in a 2 second search:



http://hub.jmonkeyengine.org/groups/physics/forum/topic/character-enemy-collision-with-player/



need another control like ghost control

First of all, thanks!



How would I include the GhostControl?



I tried adding both the Ghost- and the CharacterControl to the Characters, but that of course didn’t work.



Then I tried putting each character inside it’s own ghostNode with the GhostControl attached to the ghostNode and the CharacterControls attached to the characters. Here the collision occured, but the camera didn’t work anymore + the movement of the character didn’t move the CollisionShape of the GhostControl with it.



Such a simple thing can’t be this hard, and I can’t be this horrible, what am I missing?

@burninghammer said:
First of all, thanks!

How would I include the GhostControl?

I tried adding both the Ghost- and the CharacterControl to the Characters, but that of course didn't work.

Then I tried putting each character inside it's own ghostNode with the GhostControl attached to the ghostNode and the CharacterControls attached to the characters. Here the collision occured, but the camera didn't work anymore + the movement of the character didn't move the CollisionShape of the GhostControl with it.

Such a simple thing can't be this hard, and I can't be this horrible, what am I missing?


I agree
btw i added a ball from the physics example and my caractercontrol is pushing it naturaly
so it should be easily done, donno why the caractercontrol is not reacting the same way a s the ball
and why we have to handle collisions in this complicated manner

so far i got a charactercontrol+rigidbody+ghostcontrol+debug spatials and so one, seems a lot,
especialy considering a game with hundreds of enemies
anyway i'll keep digging, and i will find a solution
but a tutorial would be nice from the developpers

i mean when you think about the amount of time it represents to create a game (modeling,texturing,riggin,animation, scripting, networking, ai, an so one), i would have dream of an engine that clears the path but, yet i am still busy with these brain breaking considerations

pffff
@rompelstilchen said:
yet i am still busy with these brain breaking considerations

If this is "brain breaking" you probably won't get far anyway. Maybe try using some FPS mod or LittleBigPlanet, they might be more suited.
@normen said:
If this is "brain breaking" you probably won't get far anyway. Maybe try using some FPS mod or LittleBigPlanet, they might be more suited.


hey man

you don't know me ok

if it is brain breaking it is because i have been working for years with newton/crystal/ode/blender achiewing cars with full suspensions steering and so one..., space crafts, hover tanks ...

what i meant is that i am on my own doing everything

no hard feelings, i am just really tired to spent time programming with almost no fun playing with the thing i try to create

and as i said a simple tutorial would help, i am not the only one to say that

i event thought about building my own integrator, wich is a tremendous piece of work, so i gave up and i turned again to
finding an engine that does it(and in java)

if i was that lame/lazy/stupid, i would be a player, not a builder

don't take me wrong i have been really really impressed by the work you achieved with jme3

Well let me put it another way then: the engine doesn’t imply any way to do games and hence it doesn’t include things like AI, specific control schemes for FPS games or the likes.