Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - viniciusDSL

Pages: [1]
1
Support / Re: project crash when remove Object3D from world JPCT AE
« on: October 13, 2012, 03:09:04 am »
very thanks for reply, it's idea works ^_^

PD: sorry my english is bad.

2
Support / Re: project crash when remove Object3D from world JPCT AE
« on: October 09, 2012, 01:52:03 am »
this is a video of mi project, in this you can see my problem, while the time passed the world have lag...the objects lose velocity...

http://minus.com/lgMkgpnDGhIta

sorry for insisting on the topic, but I love this project and I want to finish it  ;D, and thanks for help

3
Support / Re: project crash when remove Object3D from world JPCT AE
« on: October 08, 2012, 09:47:18 pm »
Ok, I understand, very thanks for the help   ;D  , now you recommend me alternative to "world.remove (myObject);" to liberate the space occupied of the Object in the memory?, because when I add objects, the world is very slow.

4
Support / Re: project crash when remove Object3D from world JPCT AE
« on: October 08, 2012, 09:14:47 pm »
sorry, method that is running all the time in the application, how onDrawFrame()


5
Support / Re: project crash when remove Object3D from world JPCT AE
« on: October 08, 2012, 08:22:16 pm »
Hello, thanks for reply, now know little of this engine, i want remove Object3D when this is not visible in the smartphone, but do not know the methods that run each second  :-\ , where I can find them?

PD:sorry for my english

6
Support / project crash when remove Object3D from world JPCT AE
« on: October 08, 2012, 05:18:19 pm »
Hello, I start with this engine JPCT AE and I try to make a game similar to guitar hero, but i have a problem when try to remove Object3D from world, this is my code:

Code: [Select]
public void onSurfaceChanged(GL10 gl, int w, int h) {
if (fb != null) {
fb.dispose();
}
fb = new FrameBuffer(gl, w, h);

if (master == null) {


texture = new Texture(BitmapHelper.rescale(
BitmapHelper.convert(getResources().getDrawable(
R.drawable.ic_launcher)), 64, 64));
TextureManager.getInstance().addTexture("texture", texture);

cube = Primitives.getCube(2);
cube.calcTextureWrapSpherical();
cube.setTexture("texture");


cube1 = Primitives.getCube(2);
cube1.calcTextureWrapSpherical();
cube1.setTexture("texture");


cube2 = Primitives.getCube(2);
cube2.calcTextureWrapSpherical();
cube2.setTexture("texture");

Camera cam = world.getCamera();
cam.moveCamera(Camera.CAMERA_MOVEOUT, 50);
cam.lookAt(new SimpleVector(0, 0, 0));

MemoryHelper.compact();

if (master == null) {
Logger.log("Saving master Activity!");
master = BrokenStrings.this;
}
}
}

public void onDrawFrame(GL10 gl) {

if (h.mTicksElapsed + 500 >= midiFile.getTick()) {
Object3D clon1 = null;
switch ((((NoteOn) midiFile).getNoteValue() % 12) % 3) {
case 0:
                                        //Create clon and add to world and LinkedList
clon1 = cube.cloneObject();
clon1.build();
clon1.setOrigin(new SimpleVector(0, -30, 10));
world.addObject(clon1);
clon1.rotateX(-10);
notes.add(clon1);
break;

case 1:
                                        //Create clon and add to world and LinkedList
clon1 = cube1.cloneObject();
clon1.build();
clon1.setOrigin(new SimpleVector(0, -30, 10));
world.addObject(clon1);
clon1.rotateX(-10);
notes.add(clon1);
break;

case 2:
                                        //Create clon and add to world and LinkedList
clon1 = cube2.cloneObject();
clon1.build();
clon1.setOrigin(new SimpleVector(0, -30, 10));
world.addObject(clon1);
clon1.rotateX(-10);
notes.add(clon1);
break;
}
midiFile = midi.nextOn();
}
fb.clear(back);
world.renderScene(fb);
world.draw(fb);
fb.display();
notes2.addAll(notes);
Iterator<Object3D> i = notes2.iterator();
Object3D _it;
while (i.hasNext()) {
_it = i.next();
_it.translate(0, 0.4f, -0.3f);
if (_it.getCenter().y > -10f) {
removeNote(_it, i);
                                        //i try to remove when the object is not visible in the smartphone
world.removeObject(_it);
}
}
notes2.addAll(notes);
notes.clear();
}
}
 



when run i have this:

10-08 11:17:53.557: E/AndroidRuntime(3188): FATAL EXCEPTION: main
10-08 11:17:53.557: E/AndroidRuntime(3188): java.lang.RuntimeException: [ 1349709473570 ] - ERROR: Can't remove object #3, because it doesn't belong to this World!
10-08 11:17:53.557: E/AndroidRuntime(3188):    at com.threed.jpct.Logger.log(Logger.java:189)
10-08 11:17:53.557: E/AndroidRuntime(3188):    at com.threed.jpct.World.removeObject(World.java:267)
10-08 11:17:53.557: E/AndroidRuntime(3188):    at com.binizzio.brokenstringsv1.BrokenStrings$3.run(BrokenStrings.java:402)
10-08 11:17:53.557: E/AndroidRuntime(3188):    at android.os.Handler.handleCallback(Handler.java:587)
10-08 11:17:53.557: E/AndroidRuntime(3188):    at android.os.Handler.dispatchMessage(Handler.java:92)
10-08 11:17:53.557: E/AndroidRuntime(3188):    at android.os.Looper.loop(Looper.java:130)
10-08 11:17:53.557: E/AndroidRuntime(3188):    at android.app.ActivityThread.main(ActivityThread.java:3835)
10-08 11:17:53.557: E/AndroidRuntime(3188):    at java.lang.reflect.Method.invokeNative(Native Method)
10-08 11:17:53.557: E/AndroidRuntime(3188):    at java.lang.reflect.Method.invoke(Method.java:507)
10-08 11:17:53.557: E/AndroidRuntime(3188):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
10-08 11:17:53.557: E/AndroidRuntime(3188):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
10-08 11:17:53.557: E/AndroidRuntime(3188):    at dalvik.system.NativeStart.main(Native Method)

Thanks for the help and best regards.
PD: sorry my english is bad

Pages: [1]