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.


Topics - gkapoor

Pages: [1]
1
Support / Need to collide two md2 (animated character)
« on: October 28, 2010, 05:43:44 pm »
Hi All,
 
I am loading two md2 (in serialize form) file using Loader.loadSerializedObject(A) and Loader.loadSerializedObject(B) in side onSurfaceCreated. A and B both are animated (like Ninja they Jump, Kick) and using animate to animate these two charcter. I want to collide both there Animated Character and want to show some change in color kind of blood when they both collide. Please let me know if anyone know the solution and please tell me the steps how can I achieve this collision between these two animated characters. I will give him some reward if he/she can help me to get out of this problem or find some solution.
Inside public void onSurfaceCreated(GL10 gl, EGLConfig config) I am trying with following method but itís  not working . I am not able to find any Collision and CollisionListener is not working.

A.animate (counter, animationSequenceCounter)
B.animate (counter, animationSequenceCounter)

A.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
A.setCollisionOptimization(Object3D.COLLISION_DETECTION_OPTIMIZED);
B.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
B.setCollisionOptimization(Object3D.COLLISION_DETECTION_OPTIMIZED);
A.addCollisionListener(new CollisionListener()
{
@Override
public boolean requiresPolygonIDs()
{
                                 return true;
}
@Override
public void collision(CollisionEvent e)
{
   if (e.getType()==CollisionEvent.TYPE_TARGET && e.getSource()!=null)
     {
                                    destroy();
                     
    
}
}
 });
B.addCollisionListener(new CollisionListener()
{
@Override
public boolean requiresPolygonIDs()
{
return true;
}
               
@Override
public void collision(CollisionEvent e)
{
                  
if (e.getType()==CollisionEvent.TYPE_TARGET && e.getSource()!=null)
 {
destroy();
    }
                  
}
 });

Thanks & Regards,
GKapoor

2
Support / out of memory
« on: October 16, 2010, 12:22:38 pm »
Hi, i am not able load model second time its giving out of memory issue..first time its working fine....please see this log

----------------------------------------------------------
10-16 15:20:27.552: INFO/dalvikvm-heap(3017): Clamp target GC heap from 25.982MB to 24.000MB
10-16 15:20:27.552: DEBUG/dalvikvm(3017): GC freed 886 objects / 22952 bytes in 39ms
10-16 15:20:27.552: INFO/dalvikvm-heap(3017): Forcing collection of SoftReferences for 3812-byte allocation
10-16 15:20:27.592: INFO/dalvikvm-heap(3017): Clamp target GC heap from 25.982MB to 24.000MB
10-16 15:20:27.592: DEBUG/dalvikvm(3017): GC freed 0 objects / 0 bytes in 39ms
10-16 15:20:27.592: ERROR/dalvikvm-heap(3017): Out of memory on a 3812-byte allocation.
10-16 15:20:27.592: INFO/dalvikvm(3017): "GLThread 9" prio=5 tid=13 RUNNABLE
10-16 15:20:27.592: INFO/dalvikvm(3017):   | group="main" sCount=0 dsCount=0 s=N obj=0x46421490 self=0x161568
10-16 15:20:27.592: INFO/dalvikvm(3017):   | sysTid=3055 nice=0 sched=0/0 cgrp=default handle=1300368
10-16 15:20:27.592: INFO/dalvikvm(3017):   at com.threed.jpct.DeSerializer.readFloatArray(DeSerializer.java:~300)
10-16 15:20:27.592: INFO/dalvikvm(3017):   at com.threed.jpct.DeSerializer.readMesh(DeSerializer.java:279)
10-16 15:20:27.592: INFO/dalvikvm(3017):   at com.threed.jpct.DeSerializer.readAnimation(DeSerializer.java:236)
10-16 15:20:27.592: INFO/dalvikvm(3017):   at com.threed.jpct.DeSerializer.deserialize(DeSerializer.java:180)
10-16 15:20:27.592: INFO/dalvikvm(3017):   at com.threed.jpct.Loader.loadSerializedObject(Loader.java:97)
10-16 15:20:27.592: INFO/dalvikvm(3017):   at android.thearena.Game$Renderer.onSurfaceCreated(Game.java:623)
10-16 15:20:27.592: INFO/dalvikvm(3017):   at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1114)
10-16 15:20:27.592: INFO/dalvikvm(3017):   at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:977)
10-16 15:20:27.592: ERROR/dalvikvm(3017): Out of memory: Heap Size=20423KB, Allocated=19819KB, Bitmap Size=4188KB
10-16 15:20:27.632: WARN/dalvikvm(3017): threadid=13: thread exiting with uncaught exception (group=0x4001b390)
10-16 15:20:27.642: ERROR/AndroidRuntime(3017): Uncaught handler: thread GLThread 9 exiting due to uncaught exception
10-16 15:20:27.642: ERROR/AndroidRuntime(3017): java.lang.OutOfMemoryError
10-16 15:20:27.642: ERROR/AndroidRuntime(3017):     at com.threed.jpct.DeSerializer.readFloatArray(DeSerializer.java:300)
10-16 15:20:27.642: ERROR/AndroidRuntime(3017):     at com.threed.jpct.DeSerializer.readMesh(DeSerializer.java:279)
10-16 15:20:27.642: ERROR/AndroidRuntime(3017):     at com.threed.jpct.DeSerializer.readAnimation(DeSerializer.java:236)
10-16 15:20:27.642: ERROR/AndroidRuntime(3017):     at com.threed.jpct.DeSerializer.deserialize(DeSerializer.java:180)
10-16 15:20:27.642: ERROR/AndroidRuntime(3017):     at com.threed.jpct.Loader.loadSerializedObject(Loader.java:97)
10-16 15:20:27.642: ERROR/AndroidRuntime(3017):     at android.thearena.Game$Renderer.onSurfaceCreated(Game.java:623)
10-16 15:20:27.642: ERROR/AndroidRuntime(3017):     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1114)
10-16 15:20:27.642: ERROR/AndroidRuntime(3017):     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:977)
10-16 15:20:27.682: VERBOSE/WifiStateTracker(77): DhcpHandler: DHCP request succeeded
10-16 15:20:27.692: DEBUG/WifiStateTracker(77): DhcpHandler: release ddWakeLock
10-16 15:20:27.692: INFO/wpa_supplicant(123): Rx Data Filter Add [5] command
10-16 15:20:27.692: DEBUG/WifiStateTracker(77): change state to connected for wifi supplicant state=COMPLETED
---------------------------------------------------------------------------------------------

!!!!!!!!!!!!!!please help me to get out of this issue!!!!!!!!!!!!!!



3
Hello,

Please Help me!!!!!!!!! :(

Im having following files

1. subordinate.obj
2. sub_tex_002.tga
3. weap_tex_010.tga
4. weap_tex_012.tga
5. weap_tex_019.tga
6. subordinate.mtl

4 tga texture file and one mtl file of my single .obj file. How can i texture "subordinate.obj" file with these tga file?
 
Thanks & Regards,
gkapoor

4
Support / How to Load .obj file using JPCT in Android?
« on: August 24, 2010, 02:08:19 pm »
Hello,

I am a newer to JPCT. I want to load .obj file using JPCT. It will be very appreciated if anyone could give me such example.

Thanks & Regards,

gkapoor

Pages: [1]