简体   繁体   English

java3d检测特定对象而不是所有碰撞

[英]java3d detect specific object and not all the collisions

hello everyone i have a 3d game where the player sould not pass through wall. 大家好,我有一个3D游戏,玩家不能通过墙壁。 i have problem in detect the collision i have tried the WakeupOnCollisionEntry WakeupOnCollisionExit but there is a problem. 我有问题检测碰撞我已经尝试过WakeupOnCollisionEntry WakeupOnCollisionExit但是有问题。 imagine a plane and a player on that plane and the plane surrounded with walls and a player should not pass through walls. 想象一架飞机和一名球员在那架飞机上,飞机被墙壁包围,玩家不应该穿过墙壁。 but when i tried to use the WakeupOnCollisionEntry because the player is on the plane so its detecting it and not working with the walls. 但是当我试图使用WakeupOnCollisionEntry时,因为播放器在飞机上,所以它检测它并且不使用墙壁。 my question is if it possible to ignore the plane detection and to specify a specific objects that i want the player to collide with (like ignore plane and detect the walls). 我的问题是,是否可以忽略平面检测并指定我希望玩家与之碰撞的特定对象(如忽略平面并检测墙壁)。 i cant paste here all the code because its alot of code lines so sorry for that i will be very thankful for everyone that can help me with that because im trying to do that about a week and its not working for me. 我不能粘贴所有的代码,因为它的代码行很多,很抱歉,我会非常感谢每个可以帮助我的人,因为我试着这样做一个星期而且它不适合我。

setCollidable(false); setCollidable(假); this lina helps avoid collision 这个lina有助于避免碰撞

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM