|
From: <ju...@us...> - 2007-06-26 23:25:52
|
Revision: 14396
http://bzflag.svn.sourceforge.net/bzflag/?rev=14396&view=rev
Author: judecn
Date: 2007-06-26 16:25:53 -0700 (Tue, 26 Jun 2007)
Log Message:
-----------
Hopefully this fixes the Apple OSX build problem :)
Modified Paths:
--------------
trunk/bzworkbench/Debug/makefile
trunk/bzworkbench/Debug/model/subdir.mk
trunk/bzworkbench/Debug/sources.mk
trunk/bzworkbench/Debug/subdir.mk
trunk/bzworkbench/include/objects/box.h
trunk/bzworkbench/objects/box.cpp
trunk/bzworkbench/share/test.bzw
trunk/bzworkbench/windows/View.cpp
Added Paths:
-----------
trunk/bzworkbench/Debug/share/
trunk/bzworkbench/Debug/share/box/
trunk/bzworkbench/Debug/share/box/subdir.mk
trunk/bzworkbench/share/box/
trunk/bzworkbench/share/box/box.mtl
trunk/bzworkbench/share/box/box.obj
trunk/bzworkbench/share/box/boxwall.png
trunk/bzworkbench/share/box/roof.png
Modified: trunk/bzworkbench/Debug/makefile
===================================================================
--- trunk/bzworkbench/Debug/makefile 2007-06-26 22:49:10 UTC (rev 14395)
+++ trunk/bzworkbench/Debug/makefile 2007-06-26 23:25:53 UTC (rev 14396)
@@ -11,6 +11,7 @@
-include subdir.mk
-include windows/subdir.mk
-include widgets/subdir.mk
+-include share/box/subdir.mk
-include objects/subdir.mk
-include model/subdir.mk
-include dialogs/subdir.mk
@@ -48,7 +49,7 @@
bzworkbench: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: GCC C++ Linker'
- g++ -L/usr/lib -L/usr/X11R6/lib -L/usr/local/lib/ -o"bzworkbench" $(OBJS) $(USER_OBJS) $(LIBS)
+ g++ -L/usr/lib -L/usr/local/lib/ -o "bzworkbench" $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
Modified: trunk/bzworkbench/Debug/model/subdir.mk
===================================================================
--- trunk/bzworkbench/Debug/model/subdir.mk 2007-06-26 22:49:10 UTC (rev 14395)
+++ trunk/bzworkbench/Debug/model/subdir.mk 2007-06-26 23:25:53 UTC (rev 14396)
@@ -23,7 +23,7 @@
model/%.o: ../model/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: GCC C++ Compiler'
- g++ -I/usr/include/ -I/usr/X11R6/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
+ g++ -I/usr/include/ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
@echo 'Finished building: $<'
@echo ' '
Added: trunk/bzworkbench/Debug/share/box/subdir.mk
===================================================================
--- trunk/bzworkbench/Debug/share/box/subdir.mk (rev 0)
+++ trunk/bzworkbench/Debug/share/box/subdir.mk 2007-06-26 23:25:53 UTC (rev 14396)
@@ -0,0 +1,11 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+# Add inputs and outputs from these tool invocations to the build variables
+OBJ_SRCS += \
+../share/box/box.obj
+
+
+# Each subdirectory must supply rules for building sources it contributes
+
Modified: trunk/bzworkbench/Debug/sources.mk
===================================================================
--- trunk/bzworkbench/Debug/sources.mk 2007-06-26 22:49:10 UTC (rev 14395)
+++ trunk/bzworkbench/Debug/sources.mk 2007-06-26 23:25:53 UTC (rev 14396)
@@ -25,6 +25,7 @@
SUBDIRS := \
windows \
widgets \
+share/box \
objects \
model \
. \
Modified: trunk/bzworkbench/Debug/subdir.mk
===================================================================
--- trunk/bzworkbench/Debug/subdir.mk 2007-06-26 22:49:10 UTC (rev 14395)
+++ trunk/bzworkbench/Debug/subdir.mk 2007-06-26 23:25:53 UTC (rev 14396)
@@ -24,14 +24,14 @@
%.o: ../%.cxx
@echo 'Building file: $<'
@echo 'Invoking: GCC C++ Compiler'
- g++ -I/usr/include/ -I/usr/X11R6/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
+ g++ -I/usr/include/ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
@echo 'Finished building: $<'
@echo ' '
%.o: ../%.cpp
@echo 'Building file: $<'
@echo 'Invoking: GCC C++ Compiler'
- g++ -I/usr/include/ -I/usr/X11R6/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
+ g++ -I/usr/include/ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
@echo 'Finished building: $<'
@echo ' '
Modified: trunk/bzworkbench/include/objects/box.h
===================================================================
--- trunk/bzworkbench/include/objects/box.h 2007-06-26 22:49:10 UTC (rev 14395)
+++ trunk/bzworkbench/include/objects/box.h 2007-06-26 23:25:53 UTC (rev 14396)
@@ -7,6 +7,8 @@
#include "../model/BZWParser.h"
#include "bz2object.h"
+#include "../model/SceneBuilder.h"
+
/**
* Box data
*/
@@ -35,8 +37,8 @@
// toString
string toString(void);
- // render
- int render(void);
+ // return renderable OSG node
+ osg::ref_ptr< osg::Node > getRenderable();
private:
Point3D size;
Modified: trunk/bzworkbench/objects/box.cpp
===================================================================
--- trunk/bzworkbench/objects/box.cpp 2007-06-26 22:49:10 UTC (rev 14395)
+++ trunk/bzworkbench/objects/box.cpp 2007-06-26 23:25:53 UTC (rev 14396)
@@ -29,7 +29,13 @@
"end\n";
}
-// render
-int box::render(void) {
- return 0;
+// get renderable
+osg::ref_ptr< osg::Node > box::getRenderable() {
+ osg::PositionAttitudeTransform* boxTransform = SceneBuilder::transformable( SceneBuilder::buildNode( "share/box/box.obj" ).get() ).get();
+
+ boxTransform->setPosition( osg::Vec3(this->position.x, this->position.y, this->position.z + this->size.z / 2.0) );
+ boxTransform->setScale( osg::Vec3(this->size.x, this->size.y, this->size.z / 2.0) );
+ boxTransform->setAttitude( osg::Quat( osg::DegreesToRadians( this->rotation ), osg::Vec3( 0.0, 0.0, 1.0 ) ) );
+
+ return osg::ref_ptr<osg::Node> (boxTransform);
}
Added: trunk/bzworkbench/share/box/box.mtl
===================================================================
--- trunk/bzworkbench/share/box/box.mtl (rev 0)
+++ trunk/bzworkbench/share/box/box.mtl 2007-06-26 23:25:53 UTC (rev 14396)
@@ -0,0 +1,24 @@
+# Blender3D MTL File: planet.blend
+# Material Count: 2
+newmtl Material_boxwall.png
+Ns 96.078431
+Ka 0.000000 0.000000 0.000000
+Kd 0.640000 0.640000 0.640000
+Ks 0.500000 0.500000 0.500000
+Ni 1.000000
+d 1.000000
+illum 2
+map_Kd boxwall.png
+
+
+newmtl Material_roof.png
+Ns 96.078431
+Ka 0.000000 0.000000 0.000000
+Kd 0.640000 0.640000 0.640000
+Ks 0.500000 0.500000 0.500000
+Ni 1.000000
+d 1.000000
+illum 2
+map_Kd roof.png
+
+
Added: trunk/bzworkbench/share/box/box.obj
===================================================================
--- trunk/bzworkbench/share/box/box.obj (rev 0)
+++ trunk/bzworkbench/share/box/box.obj 2007-06-26 23:25:53 UTC (rev 14396)
@@ -0,0 +1,31 @@
+# Blender v242 OBJ File: planet.blend
+# www.blender3d.org
+mtllib box.mtl
+o Cube_Cube
+v 1.000000 -1.000000 -1.000000
+v 1.000000 -1.000000 1.000000
+v -1.000000 -1.000000 1.000000
+v -1.000000 -1.000000 -1.000000
+v 1.000000 1.000000 -0.999999
+v 0.999999 1.000000 1.000001
+v -1.000000 1.000000 1.000000
+v -1.000000 1.000000 -1.000000
+vt 0.000000 1.000000 0.0
+vt 0.000000 0.000000 0.0
+vt 1.000000 0.000000 0.0
+vt 1.000000 1.000000 0.0
+vn 1.000000 0.000000 0.000000
+vn -0.000000 -0.000000 1.000000
+vn -1.000000 -0.000000 -0.000000
+vn 0.000000 0.000000 -1.000000
+vn 0.000000 -1.000000 -0.000000
+vn -0.000000 1.000000 0.000000
+usemtl Material_boxwall.png
+s off
+f 1/1/1 5/2/1 6/3/1 2/4/1
+f 2/1/2 6/2/2 7/3/2 3/4/2
+f 3/1/3 7/2/3 8/3/3 4/4/3
+f 5/1/4 1/2/4 4/3/4 8/4/4
+usemtl Material_roof.png
+f 1/1/5 2/2/5 3/3/5 4/4/5
+f 5/1/6 8/2/6 7/3/6 6/4/6
Added: trunk/bzworkbench/share/box/boxwall.png
===================================================================
(Binary files differ)
Property changes on: trunk/bzworkbench/share/box/boxwall.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/bzworkbench/share/box/roof.png
===================================================================
(Binary files differ)
Property changes on: trunk/bzworkbench/share/box/roof.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/bzworkbench/share/test.bzw
===================================================================
--- trunk/bzworkbench/share/test.bzw 2007-06-26 22:49:10 UTC (rev 14395)
+++ trunk/bzworkbench/share/test.bzw 2007-06-26 23:25:53 UTC (rev 14396)
@@ -1,19 +1,13 @@
world
name poop
flagHeight 1
- size 800
+ size 400
end
-waterLevel
- name sniff
- matref lava
- height 1.0
-end
-
# this will be ignored
box
- position 20 30 40
+ position -100 0 0
size 10 10 10 # this too
rotation 40
end
@@ -21,7 +15,7 @@
define theTestGroup
box
- position 20 30 40
+ position -100 -30 40
size 10 10 10
rotation 40
end
@@ -32,31 +26,3 @@
rotation 45
end
enddef
-
-pyramid
- position 30 40 60
- size 40 40 40
- rotation 40
-end
-
-mesh
- vertex 0 0 0
- vertex 1 1 1
- vertex 0 0 0
-
- face
- vertices 0 1 2
- endface
-end
-
-box
- position 1 2 3
- size 4 5 6
- rotation 7
-end
-
-pyramid
- position 8 9 10
- size 11 12 13
- rotation 14
-end
Modified: trunk/bzworkbench/windows/View.cpp
===================================================================
--- trunk/bzworkbench/windows/View.cpp 2007-06-26 22:49:10 UTC (rev 14395)
+++ trunk/bzworkbench/windows/View.cpp 2007-06-26 23:25:53 UTC (rev 14396)
@@ -28,16 +28,19 @@
osg::ref_ptr<osg::PositionAttitudeTransform> cow1 = SceneBuilder::transformable( SceneBuilder::buildNode( "share/cow.osg" ).get() );
osg::ref_ptr<osg::PositionAttitudeTransform> cow2 = SceneBuilder::transformable( SceneBuilder::buildNode( "share/cow.osg" ).get() );
osg::ref_ptr<osg::PositionAttitudeTransform> cow3 = SceneBuilder::transformable( SceneBuilder::buildNode( "share/cow.osg" ).get() );
+ osg::ref_ptr<osg::PositionAttitudeTransform> box = SceneBuilder::transformable( SceneBuilder::buildNode( "share/box/box.obj" ).get() );
// move the cow up a bit
cow1->setPosition( osg::Vec3(0, 0, 3) );
cow2->setPosition( osg::Vec3(10, 10, 3) );
cow3->setPosition( osg::Vec3(-10, 10, 3) );
+ box->setPosition( osg::Vec3(10, -10, 1) );
// add the cow model as a leaf to root
this->root->addChild( cow1.get() );
this->root->addChild( cow2.get() );
this->root->addChild( cow3.get() );
+ this->root->addChild(box.get());
// add the root node to the scene
this->setSceneData( this->root.get() );
@@ -46,7 +49,7 @@
this->setCameraManipulator(new osgGA::TrackballManipulator());
// add the stats event handler
- this->addEventHandler(new osgViewer::StatsHandler);
+ this->addEventHandler(new osgViewer::StatsHandler());
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|