Skip to content

Commit

Permalink
zbtSet(Get)UserPointer() changed to zbtSet(Get)UserModel()
Browse files Browse the repository at this point in the history
  • Loading branch information
Rado-1 committed Jun 8, 2015
1 parent dad9cf7 commit b83880b
Show file tree
Hide file tree
Showing 12 changed files with 843 additions and 51 deletions.
13 changes: 4 additions & 9 deletions demos/demo1/PhysicsDemo1.zgeproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1" ?>
<ZApplication Name="App" Comment="ZgeBullet demo #1. Created by Rado1" Caption="Physics Demo 1" FrameRateStyle="1" ScreenMode="0" CameraPosition="-48.0318 10 35.9576" CameraRotation="0 2.1477 0" ViewportRatio="3" ClipFar="800" MouseVisible="255" NoSound="1" AndroidPackageName="com.rado1.PhysicsDemo1">
<ZApplication Name="App" Comment="ZgeBullet demo #1. Created by Rado1" Caption="Physics Demo 1" FrameRateStyle="1" ScreenMode="0" CameraPosition="-17.179 10 57.4881" CameraRotation="0 0.0462 0" ViewportRatio="3" ClipFar="800" MouseVisible="255" NoSound="1" AndroidPackageName="com.rado1.PhysicsDemo1">
<OnLoaded>
<ZExternalLibrary Comment="Bullet 3D physics" ModuleName="ZgeBullet" CallingConvention="1" BeforeInitExp="if(ANDROID) this.ModuleName = &quot;./libZgeBullet.so&quot;;">
<Source>
Expand Down Expand Up @@ -458,9 +458,9 @@ void zbtSetUserIndex(xptr obj, int index) {}
int zbtGetUserIndex(xptr obj) {}
void zbtSetUserPointer(xptr obj, xptr pointer) {}
void zbtSetUserModel(xptr obj, model userModel) {}
xptr zbtGetUserPointer(xptr obj) {}
model zbtGetUserModel(xptr obj) {}
// Collision detection
Expand Down Expand Up @@ -1002,12 +1002,7 @@ if(shooting){
<RenderText Comment="FPS" TextFloatRef="App.FpsCounter" X="-0.97" Y="0.9" Scale="0.5" Align="1"/>
</OnRender>
<OnClose>
<ZExpression>
<Expression>
<![CDATA[// destroy physical world
zbtDestroyWorld();]]>
</Expression>
</ZExpression>
<ZExpression Comment="Destroy physical world" Expression="zbtDestroyWorld();"/>
</OnClose>
<Lights>
<Light Position="50 50 50" Color="1 1 0 1" Kind="1"/>
Expand Down
27 changes: 22 additions & 5 deletions demos/demo1/README.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
ZgeBullet Demo Project #1
=========================

This is a ZGameEditor project file which demonstrates the basic possibilities of the ZgeBullet library and shows its usage. In particular, you can see how to create 3D physical world, define collision shapes, place rigid bodies to a physical world, bind graphical objects to their rigid bodies, step simulation time, and update properties of objects by discrete simulation.
This is a ZGameEditor project file which demonstrates the basic possibilities of
the ZgeBullet library and shows its usage. In particular, you can see how to
create 3D physical world, define collision shapes, place rigid bodies to a
physical world, bind graphical objects to their rigid bodies, step simulation
time, and update properties of objects by discrete simulation.

The demo uses a generic framework of creating 3D objects, specification their properties, and placing them to a world. Users are, therefore, allowed to easily define their own object formations and to modify or extend this demo. See the 'InitScene' component for details on how to define formations of objects in scenes.
The demo uses a generic framework of creating 3D objects, specification their
properties, and placing them to a world. Users are, therefore, allowed to easily
define their own object formations and to modify or extend this demo. See the
'InitScene' component for details on how to define formations of objects in
scenes.

To run the demo on Windows, copy the ZgeBullet DLL to the same directory as this project and/or the generated EXE file.
To run the demo on Windows, copy the ZgeBullet DLL to the same directory as this
project and/or the generated EXE file.

To run the demo application on Android, activate the menu item "Android: Build APK (debug)" in ZGE. Then, copy the appropriate libZgeBullet.so file to the libs\ermabi\ folder of the generated directory and regenerate the Android application again. In the bin\ folder of the generated directory you will find the .apk file which you install on your Android device.
To run the demo application on Android, activate the menu item
"Android: Build APK (debug)" in ZGE. Then, copy the appropriate libZgeBullet.so
file to the libs\ermabi\ folder of the generated directory and regenerate the
Android application again. In the bin\ folder of the generated directory you
will find the .apk file which you install on your Android device.

Note: Use the libZGEBullet.so file compatible with your device. In other case, the application can crash. It is recommended to use modern (e.g., ARMv7-A compatible) devices which can achieve much better performance for large amount of objects on a scene. If you have older device, you can, for instance, decrease the number of simulated physical objects to achieve smoother movements.
Note: Use the libZGEBullet.so file compatible with your device. In other case,
the application can crash. It is recommended to use modern (e.g., ARMv7-A
compatible) devices which can achieve much better performance for large amount
of objects on a scene. If you have older device, you can, for instance, decrease
the number of simulated physical objects to achieve smoother movements.

Have fun!
Rado1.
14 changes: 4 additions & 10 deletions demos/demo2/PhysicsDemo2.zgeproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1" ?>
<ZApplication Name="App" Comment="ZgeBullet demo #2. Created by Rado1" Caption="Physics Demo 2" ClearColor="0 0 0 1" AmbientLightColor="0.6353 0.6353 0.6353 1" FrameRateStyle="1" ScreenMode="0" CameraPosition="78.9108 30 13.156" CameraRotation="0.05 -0.2237 0" LightPosition="0 0 0" ViewportRatio="3" CustomViewportRatio="1.6667" ClipFar="800" MouseVisible="255" NoSound="1" AndroidPackageName="com.rado1.PhysicsDemo2">
<ZApplication Name="App" Comment="ZgeBullet demo #2. Created by Rado1" Caption="Physics Demo 2" ClearColor="0 0 0 1" AmbientLightColor="0.6353 0.6353 0.6353 1" FrameRateStyle="1" ScreenMode="0" CameraPosition="-15.0407 30 78.5734" CameraRotation="0.05 0.0301 0" LightPosition="0 0 0" ViewportRatio="3" CustomViewportRatio="1.6667" ClipFar="800" MouseVisible="255" NoSound="1" AndroidPackageName="com.rado1.PhysicsDemo2">
<OnLoaded>
<ZExternalLibrary Comment="Bullet 3D physics" ModuleName="ZgeBullet" CallingConvention="1" BeforeInitExp="if(ANDROID) this.ModuleName = &quot;./libZgeBullet.so&quot;;">
<Source>
Expand Down Expand Up @@ -458,9 +458,9 @@ void zbtSetUserIndex(xptr obj, int index) {}
int zbtGetUserIndex(xptr obj) {}
void zbtSetUserPointer(xptr obj, xptr pointer) {}
void zbtSetUserModel(xptr obj, model userModel) {}
xptr zbtGetUserPointer(xptr obj) {}
model zbtGetUserModel(xptr obj) {}
// Collision detection
Expand Down Expand Up @@ -612,13 +612,7 @@ else if(touchGetCount() > 1) // more than 1 touch - remove spheres
<RenderText Name="SphereCount" Text="0" X="0.78" Y="0.9" Scale="0.5" Align="1"/>
</OnRender>
<OnClose>
<ZExpression>
<Expression>
<![CDATA[// destroy physical world, collision shapes and height lists
zbtDestroyWorld();
zbtDeleteAllShapes();]]>
</Expression>
</ZExpression>
<ZExpression Comment="Destroy physical world" Expression="zbtDestroyWorld();"/>
</OnClose>
<Lights>
<Light Position="20 50 20" Color="1 1 0 1" SpotDirection="0 -1 0" SpotCutoff="0"/>
Expand Down
20 changes: 16 additions & 4 deletions demos/demo2/README.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
ZgeBullet Demo Project #2
=========================

This is a ZGameEditor project which demonstrates usage of dynamic heightfield terrains. Press and hold left mouse button to change the terrain on Windows (single touch on Android). Press Space to remove all spawn spheres on Windows (touch with more than one finger on Android).
This is a ZGameEditor project which demonstrates usage of dynamic heightfield
terrains. Press and hold left mouse button to change the terrain on Windows
(single touch on Android). Press Space to remove all spawn spheres on Windows
(touch with more than one finger on Android).

To run the demo on Windows, copy the ZgeBullet.dll to the same directory as this project and/or the generated EXE file.
To run the demo on Windows, copy the ZgeBullet.dll to the same directory as this
project and/or the generated EXE file.

To run the demo application on Android, activate the menu item "Android: Build APK (debug)" in ZGE. Then, copy the appropriate libgeEBullet.so file to the libs\ermabi\ folder of the generated directory and regenerate the Android application again. In the bin\ folder of the generated directory you will find the .apk file which you install on your Android device.
To run the demo application on Android, activate the menu item
"Android: Build APK (debug)" in ZGE. Then, copy the appropriate libgeEBullet.so
file to the libs\ermabi\ folder of the generated directory and regenerate the
Android application again. In the bin\ folder of the generated directory you
will find the .apk file which you install on your Android device.

Note: Use the libZgeBullet.so file compatible with your device. In other case, the application can crash. It is recommended to use modern (e.g., ARMv7-A compatible) devices which can achieve much better performance for large amount of objects on a scene. If you have older device, you can, for instance, decrease the number of simulated physical objects to achieve smoother movements.
Note: Use the libZgeBullet.so file compatible with your device. In other case,
the application can crash. It is recommended to use modern (e.g., ARMv7-A
compatible) devices which can achieve much better performance for large amount
of objects on a scene. If you have older device, you can, for instance, decrease
the number of simulated physical objects to achieve smoother movements.

Have fun!
Rado1.
6 changes: 3 additions & 3 deletions demos/demo3/PhysicsDemo3.zgeproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1" ?>
<ZApplication Name="App" Comment="ZgeBullet demo #3. Created by Rado1" Caption="Physics Demo 3" AmbientLightColor="0.502 0.502 0.502 1" FrameRateStyle="1" ScreenMode="0" CameraPosition="0.0945 11.517 -25.0144" CameraRotation="0.06 0.5 0" LightPosition="0 30 0" ViewportRatio="3" ClipFar="1000" MouseVisible="255" NoSound="1" AndroidPackageName="com.rado1.PhysicsDemo3">
<ZApplication Name="App" Comment="ZgeBullet demo #3. Created by Rado1" Caption="Physics Demo 3" AmbientLightColor="0.502 0.502 0.502 1" FrameRateStyle="1" ScreenMode="0" CameraPosition="-3.7244 8.3467 -28.8006" CameraRotation="0.06 0.5 0" LightPosition="0 30 0" ViewportRatio="3" ClipFar="1000" MouseVisible="255" NoSound="1" AndroidPackageName="com.rado1.PhysicsDemo3">
<OnLoaded>
<ZExternalLibrary Comment="Bullet 3D physics" ModuleName="ZgeBullet" CallingConvention="1" BeforeInitExp="if(ANDROID) this.ModuleName = &quot;./libZgeBullet.so&quot;;">
<Source>
Expand Down Expand Up @@ -458,9 +458,9 @@ void zbtSetUserIndex(xptr obj, int index) {}
int zbtGetUserIndex(xptr obj) {}
void zbtSetUserPointer(xptr obj, xptr pointer) {}
void zbtSetUserModel(xptr obj, model userModel) {}
xptr zbtGetUserPointer(xptr obj) {}
model zbtGetUserModel(xptr obj) {}
// Collision detection
Expand Down
24 changes: 19 additions & 5 deletions demos/demo3/README.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
ZgeBullet Demo Project #3
=========================

This is a ZGameEditor project file which demonstrates the basic possibilities of the ZgeBullet library to create and use Raycast Vehicle, a simple car simulation.
This is a ZGameEditor project file which demonstrates the basic possibilities
of the ZgeBullet library to create and use Raycast Vehicle, a simple car
simulation.

To drive the car: move mouse (or touch on Android) left/right to steer, put mouse to upper section to move forward, put mouse to lower section to break. Press right mouse button (or double-touch on Android) to reinitialize the scene.
To drive the car: move mouse (or touch on Android) left/right to steer, put
mouse to upper section to move forward, put mouse to lower section to break.
Press right mouse button (or double-touch on Android) to reinitialize the scene.

To run the demo on Windows, copy the ZgeBullet DLL to the same directory as this project and/or the generated EXE file.
To run the demo on Windows, copy the ZgeBullet DLL to the same directory as this
project and/or the generated EXE file.

To run the demo application on Android, activate the menu item "Android: Build APK (debug)" in ZGE. Then, copy the appropriate libZgeBullet.so file to the libs\ermabi\ folder of the generated directory and regenerate the Android application again. Tthe bin\ folder of the generated directory will contain the .apk file which you install on your Android device.
Note: Use the libZGEBullet.so file compatible with your device. In other case, the application can crash. It is recommended to use modern (e.g., ARMv7-A compatible) devices which can achieve much better performance for large amount of objects on a scene. If you have older device, you can, for instance, decrease the number of simulated physical objects to achieve smoother movements.
To run the demo application on Android, activate the menu item
"Android: Build APK (debug)" in ZGE. Then, copy the appropriate libZgeBullet.so
file to the libs\ermabi\ folder of the generated directory and regenerate the
Android application again. Tthe bin\ folder of the generated directory will
contain the .apk file which you install on your Android device.

Note: Use the libZGEBullet.so file compatible with your device. In other case,
the application can crash. It is recommended to use modern (e.g., ARMv7-A
compatible) devices which can achieve much better performance for large amount
of objects on a scene. If you have older device, you can, for instance, decrease
the number of simulated physical objects to achieve smoother movements.

Have fun!
Rado1.
Loading

0 comments on commit b83880b

Please sign in to comment.