Author Topic: collision detection  (Read 2579 times)

Offline manumoi

  • long
  • ***
  • Posts: 121
    • View Profile
collision detection
« on: July 04, 2005, 11:49:13 pm »
Hello, i m having a problem with collision detection...
I create a terrain object with many triangles.

then i call this function

 public void setupTerrainOctreeAndCollision(){
   OcTree oc = new OcTree(terrain, 100, OcTree.MODE_OPTIMIZED);
   Config.collideOffset = 250;

After that i create an avatar with an md2 file

public void loadModel(){
   model=Loader.loadMD2(modelPath+"tris.md2", 0.5f);

In this configuration, collisions occur and my avatar can t go through walls... But the problem is it can go through others avatars... When i try to put:


there is no more collision and i don t understand why

Do you have an idea ???

PS :

my forward method is :

// ELLIPSOID_RADIUS is defined as in the FPS example
 private void moveForward(){
   SimpleVector a = model.getZAxis();
   a = model.checkForCollisionEllipsoid(a,ELLIPSOID_RADIUS, 5);

Tell me if you need something else to understand my code

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11829
    • View Profile
collision detection
« Reply #1 on: July 05, 2005, 12:09:28 am »
Because your models should collide with others objects (models or the level) but each one should act as a collider itself to others, you have to use a combination of both modes on your model(s).

Code: [Select]