Jump to content

[SOLVED] PlayerSpectator collision detection with Objects


photo

Recommended Posts

Hi,all.

 

 

Someone,can help with creating collision detection node "PlayerSpectator" with objects(terrain and etc)?

 

I'm trying make it's,but it's not working with terrain(i can see from objects):

 

ObjectDummy baseobject=NULL;

Body bodybase=NULL;

ShapeSphere Sphere=NULL;

 

baseobject=new ObjectDummy();

baseobject.setWorldPosition( spectator.getWorldPosition() );

bodybase =new BodyDummy();

bodybase.setObject(baseobject);

Sphere = new ShapeSphere(bodybase,10);

Link to comment

All of the objects samples have this functionality, including terrain collision. I suggest you check them out. The files are in C:\Unigine binary SDK\data\samples\objects . Also make sure your collidable surfaces have the surface_base property assigned to them and that the nodes the surfaces belong to (and their parents) are unscaled.

Link to comment

Hi,

 

please check SDK\data\samples\players\actor_01 sample. You probably should use PlayerPersecutor instead of PlayerSpectator. Also, you should enable 'collision' flag for proper surfaces.

Link to comment

Thanks for reply

it's another problem,because we must use PlayerSpectator for changing angle(when user want it)

 

for example this

(3.24-3.26)-solution without collision.

I'm not sure what we must using collision,just (PlayerSpectator don't must see from objects(terrain and another nodes)).

 

On russian:

Спасибо за ответ.

 

EDIT:

Это другая проблема мы хотим,что бы игрок мог менять ракурс,наблюдая персонажа с разных ракурсов(PlayerSpectator не должен проходить сквозь другие объекты-коллизия работает со всеми объектами,но на некотором расстоянии камера работает,а вот коллизии для неё нет)

В видео-есть похожее решение,но мы не можем его использовать.

Edited by nick_de
Link to comment

Edit:

 

Притом коллизия PlayerSpectator'а работает -это видно если поменять радиус,но тем не менее камера все равно проникает в объекты которые от неё удалены

(похожая проблема(именно это я и пытаюсь исправить) и в actor_01).

 

 

The collision PlayerSpectator is working.

I'm trying to fix a similar problem how and in actor_01

 

Edit:

thanks,all to reply.

Now i'm using only PlayerPersecutor,but another problem(in screenshot^)-it's if i will change distance to player.

Edited by nick_de
Link to comment
  • 2 weeks later...

PlayerPersecutor (on the screenshot you posted) can penetrate other objects when the distance range for it (how far it can go away from its target and how close it can approach it) is too small and the position changes too fast. This way, it's possible there's no other option for it but to go through other nodes. If the target moves without jerks, you'll notice there are no artifacts. Less restrictive distance can improve the situation.

 

The same is valid for PlayerSpectator: it has no CCD so fast movement can result in it going below some surface.

Link to comment
×
×
  • Create New...