www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: Uncle Ray on October 13, 2014, 07:21:54 am

Title: if i want to delete the Object3D,which way better fps?
Post by: Uncle Ray on October 13, 2014, 07:21:54 am
SOLVED THX EGO





in my project,i want to create a missile,when it hit the target,it must be disappear.
i set the missile to Object3D.
Here is some ways:
1.
missile.clearobject;

2.
world.removeobject(missile);

3.missile.setvisbility(fasle);

which way is better fps?


And more,if i want object invisibility,which way is better fps?
1.setvisibility(false);
2.setTransparency(0);
3.settexture("trans"),
the"trans" is a transparent png,so the object would be invisibility.



Thx ego
Title: Re: if i want to delete the Object3D,which way better fps?
Post by: Uncle Ray on October 14, 2014, 12:42:18 pm
Any helps will be appreciated.
Title: Re: if i want to delete the Object3D,which way better fps?
Post by: EgonOlsen on October 14, 2014, 01:01:40 pm
clearObject isn't meant to used that way. If setVisibilty() or removeObject() is better depends on the way in which you plan to use these missiles. If you are going to reuse them, setVisibility() might be better. If you fire them only a few times and it never happens again, removeObject() might be better.
To make something invisible, use setVisibility() unless the invisible object is still a valid game entity, like a cloaked missile.
Title: Re: if i want to delete the Object3D,which way better fps?
Post by: Uncle Ray on October 14, 2014, 01:21:58 pm
thx,ego,got it ,setvisibility is the best_way,thx,thx ;D