Commit Graph

2454 Commits

Author SHA1 Message Date
frohlich
e495f03ee9 Ignore winding order since it is ignored later anyway.
Only emit fully defined primitives.

Modified Files:
	simgear/scene/model/BoundingVolumeBuildVisitor.hxx
2009-03-11 20:06:56 +01:00
frohlich
f5769627e4 Use SGGeod in the model placement.
Modified Files:
	simgear/scene/model/placement.cxx
	simgear/scene/model/placement.hxx
2009-03-11 20:06:56 +01:00
frohlich
06ad73f85b Add convenience function to keep position with just an other elevation.
Modified Files:
	simgear/math/SGGeod.hxx
2009-03-11 20:06:56 +01:00
frohlich
fa20363853 First step for something doing static friction stuff.
Add an id field to identify BVHMotionTransforms.
Provide a factory for ids.
Use that to identify velocity data.
Track the lowermost id in the visitors.

Modified Files:
	simgear/scene/bvh/BVHLineSegmentVisitor.cxx
	simgear/scene/bvh/BVHLineSegmentVisitor.hxx
 	simgear/scene/bvh/BVHMotionTransform.cxx
	simgear/scene/bvh/BVHMotionTransform.hxx
	simgear/scene/bvh/BVHNearestPointVisitor.hxx
	simgear/scene/bvh/BVHNode.cxx simgear/scene/bvh/BVHNode.hxx
	simgear/scene/util/SGSceneUserData.cxx
	simgear/scene/util/SGSceneUserData.hxx
2009-03-05 10:32:06 +01:00
frohlich
2564432e71 Avoid duplicate triangles.
Modified Files:
	simgear/scene/bvh/BVHStaticGeometryBuilder.hxx
2009-03-05 10:32:06 +01:00
frohlich
addf47600d Remove the StaticLeaf visitor slot.
Add a nearest point visitor.

Modified Files:
	BVHBoundingBoxVisitor.hxx BVHDebugCollectVisitor.hxx
	BVHLineSegmentVisitor.cxx BVHLineSegmentVisitor.hxx
	BVHStaticGeometryBuilder.hxx BVHStaticLeaf.cxx
	BVHStaticLeaf.hxx BVHSubTreeCollector.cxx
	BVHSubTreeCollector.hxx BVHVisitor.hxx Makefile.am bvhtest.cxx
Added Files:
	BVHNearestPointVisitor.hxx
2009-03-05 10:32:06 +01:00
frohlich
7f534a7966 Crude hack to work around my today introduced collision tree sharing problem.
Modified Files:
	simgear/scene/model/ModelRegistry.cxx
2009-03-05 10:32:06 +01:00
frohlich
eabffece1f Don't waste space with too huge stl containers.
Modified Files:
	simgear/scene/bvh/BVHStaticGeometryBuilder.hxx
2009-03-05 10:32:06 +01:00
frohlich
afed842ad1 Don't waste space with too huge stl containers.
Modified Files:
	simgear/scene/bvh/BVHStaticData.hxx
2009-03-05 10:32:06 +01:00
fredb
c46cfb5d47 Win32 fix 2009-03-05 10:32:06 +01:00
frohlich
34fe42bbd9 Build boundingvolumes in the model loading phase.
Modified Files:
	ModelRegistry.hxx ModelRegistry.cxx
Added Files:
	BoundingVolumeBuildVisitor.hxx
2009-03-05 10:32:06 +01:00
fredb
0c1d96b749 Update MSVC 7.1 projects - Add the BVH library 2009-03-05 10:32:06 +01:00
fredb
9b67f52d56 SGMatrix<T>::preMultTranslate should return self ( as postMultTranslate do ) 2009-03-05 10:32:06 +01:00
fredb
d37907d35d BVHLineSegmentVisitor::setLineSegmentEnd doesn't return anything 2009-03-05 10:32:05 +01:00
frohlich
fee8d0cf78 Implement setters for velocity notes in the model placement code.
Modified Files:
	simgear/scene/model/placement.cxx
	simgear/scene/model/placement.hxx
2009-03-05 10:32:05 +01:00
frohlich
f5f9c6b81f More data to attach to the user data field.
Modified Files:
 	simgear/scene/util/SGSceneUserData.hxx
2009-03-05 10:32:05 +01:00
frohlich
4e3460a34b Include the bounding volume tree on the build system.
Modified Files:
 	configure.ac simgear/scene/Makefile.am
2009-03-05 10:32:05 +01:00
frohlich
8545b6ce6b Initial commit of the bounding volume tree implementation.
The aim is to prove a better collion model in plenty ways.

Added Files:
 	.cvsignore BVHBoundingBoxVisitor.hxx
	BVHDebugCollectVisitor.hxx BVHGroup.cxx BVHGroup.hxx
	BVHLineGeometry.cxx BVHLineGeometry.hxx
	BVHLineSegmentVisitor.cxx BVHLineSegmentVisitor.hxx
	BVHMotionTransform.cxx BVHMotionTransform.hxx BVHNode.cxx
	BVHNode.hxx BVHStaticBinary.cxx BVHStaticBinary.hxx
	BVHStaticData.hxx BVHStaticGeometry.cxx BVHStaticGeometry.hxx
	BVHStaticGeometryBuilder.hxx BVHStaticLeaf.cxx
	BVHStaticLeaf.hxx BVHStaticNode.cxx BVHStaticNode.hxx
	BVHStaticTriangle.cxx BVHStaticTriangle.hxx
 	BVHSubTreeCollector.cxx BVHSubTreeCollector.hxx
	BVHTransform.cxx BVHTransform.hxx BVHVisitor.hxx Makefile.am
	bvhtest.cxx
2009-03-05 10:32:05 +01:00
frohlich
e417903c23 Additions for the boundingvolumes
Modified Files:
	SGGeometryTest.cxx SGIntersect.hxx SGLineSegment.hxx
	SGTriangle.hxx
2009-03-05 10:32:05 +01:00
frohlich
81eae3fa48 Rotate the scenery tiles so that the horizont is axis aligned.
This might help culling and much more the upcomming collision tree.

Modified Files:
	simgear/scene/tgdb/obj.cxx
2009-02-27 23:34:15 +01:00
frohlich
90c58087e8 Make material get helper function static.
Modified Files:
 	simgear/scene/material/matlib.cxx
 	simgear/scene/material/matlib.hxx
2009-02-27 23:34:15 +01:00
frohlich
19bc1e6313 Initialize random number for the tests.
Define the triangles center by the weighted sum of the vertices.

Modified Files:
	SGGeometryTest.cxx SGTriangle.hxx
2009-02-27 23:34:15 +01:00
frohlich
4a4e8c87b8 Use template arguments instead of hard coded double.
Modified Files:
	simgear/math/SGTriangle.hxx
2009-02-27 23:34:15 +01:00
frohlich
f04e559dc2 Initialize uninitialized variables.
Adapt the precision bounds to what matches the expectations of IEEE math.

Modified Files:
	SGMathTest.cxx
2009-02-27 23:34:15 +01:00
frohlich
8e5e657344 Fix problem in unit quaternion return.
Modified Files:
	SGQuat.hxx
2009-02-27 23:34:15 +01:00
frohlich
a4f1f62068 Make make check link again.
Modified Files:
	simgear/math/Makefile.am
2009-02-27 23:34:15 +01:00
frohlich
a3e279f06f The scenery center is history for a long time now.
Remove that from the transforms.

Modified Files:
	simgear/scene/model/placement.hxx
	simgear/scene/model/placementtrans.cxx
	simgear/scene/model/placementtrans.hxx
2009-02-22 23:49:45 +01:00
frohlich
d11954e80c Small cleanups, bug fixes and improovements to the geometry/math stuff.
Modified Files:
	simgear/math/SGBox.hxx simgear/math/SGIntersect.hxx
	simgear/math/SGLineSegment.hxx simgear/math/SGMatrix.hxx
	simgear/math/SGPlane.hxx simgear/math/SGRay.hxx
	simgear/math/SGSphere.hxx simgear/math/SGVec2.hxx
	simgear/math/SGVec3.hxx simgear/math/SGVec4.hxx
2009-02-22 23:49:45 +01:00
durk
812170ebce Torsten Dreyer: the rotate animation has two ways to define a axis
1. by using center/x-m and axis/[xyz]
2. by using axis/[xyz]1-m and axis/[xyz]2-m

The translate animation only supports method 1. and here comes a patch that
enables method 2 for this animations, too.
2009-02-22 23:49:45 +01:00
fredb
fdd3c77298 Fix to compile with MSC 2009-02-22 23:49:45 +01:00
Tim Moore
342de209a2 Merge branch 'topic/nasal' into next 2009-02-16 00:48:00 +01:00
mfranz
caeb32488e "io.flush() implementation from Melchior. Also add a final filetype
element to the io.stat() array, which has been sitting around on my
box for a while and doesn't seem to have broken anything."  -- Andy

(forward port from nasal/cvs)
2009-02-16 00:46:29 +01:00
Tim Moore
ff7e70f4d5 Merge branch 'topic/gcintersect' into next 2009-02-13 10:07:15 +01:00
Tim Moore
950f51909c New getPrimitive function.
This searches for the primitive found in an OSG intersection query.
2009-02-13 09:40:05 +01:00
Tim Moore
f86e6d344c Make SGSubsystemGroup::Member copy constructor private.
The copy constructor wouldn't make any sense and would confuse ownership of
the subsystem pointer. Problem noted by John Denker.
2009-02-07 00:37:47 +01:00
Tim Moore
08581282dd Merge branch 'topic/cloudz' into next 2009-02-06 19:16:19 +01:00
Tim Moore
e1e47e76ec Turn off z buffer writes for clouds.
This is standard practice for semi-transparent objects and should cut down
on the flickering and other sorting artifacts.
2009-02-06 17:48:23 +01:00
fredb
3ff059848c Update MSVC 7.1 projects - Remove pthreads dependency 2009-02-04 11:07:27 +01:00
Tim Moore
22c7df5936 Merge branch 'maint' into next 2009-02-04 11:03:20 +01:00
Tim Moore
81a44d1340 Merge branch 'releng/1.9.1' into maint 2009-02-04 11:02:30 +01:00
durk
2c089e6166 Synchronize the version number with our mainantance release. 2009-02-04 11:01:39 +01:00
Tim Moore
589dae7b0c Build trees under a transform note that is rotated to Z-up.
This allows the tree geometry to be shared across the entire scene because it
doesn't need to be rotated for each scenery tile.
2009-01-30 11:18:08 +01:00
Tim Moore
3ff13189aa Don't expand all the trees into display lists.
This can chew up large amounts of memory for questionable gains. We do
let the tree model geometry be in a display list if OSG chooses to put
it there.

Various renaming and cleanup. Save some memory by reverting
ShaderGeometry's base class back to osg::Drawable.
2009-01-30 11:17:02 +01:00
Tim Moore
7151c3fac1 Merge branch 'topic/yontree' into next 2009-01-28 07:53:38 +01:00
Tim Moore
3e023b77dd Merge branch 'maint' into next 2009-01-28 07:53:31 +01:00
durk
e3fc89890c For the first time (no pun intended) in almost ten years time (again no
pun intended) that I'm touching the time library.

 Brian Schack reported that the traffic scheduler messes up the timestamps
 of the atlas network output. As it turns out, the c library functions
 asctime, and gmtime use a static copy of the tm struct to do the internal
 formatting. Our linux port of the SGTime class, incidentally, also stored
 it's master time stamp in this very same struct. Thus, formatting an
 arbitrary time value, would have the unwanted side effect of time travel.
 Usually, this would go unnoticed, because the actual time parameters would
 be updated before any damage could be done. But unwanted side effects, as
 in Brian's example could occur.

 On the MSVC port this appears to not have been a problem. Since that port
 used a copy of the tm struct to store it's master time stamps. Since the
 MSVC code also compiles cleanly on linux, it seems to be the way to go to
 use that approach. In addition, it also removes some conditional compile
 directives.

 I've only run a short test, but didn't see any undesirable side effects.
2009-01-28 07:46:55 +01:00
mfranz
ce2a6cfe5c Csaba HALASZ: set _arg even if there's no <command> (crash fix) 2009-01-28 07:46:31 +01:00
Tim Moore
31d9eaf54c Use osg::Geometry code to draw trees ourselves.
This reverts back in the direction of Yon's original patch: the model is
drawn within ShaderGeometry::drawImplementation. This saves a lot of memory
over the previous approach of creating a PrimitiveSet for each model.
2009-01-28 07:43:09 +01:00
Tim Moore
781c445d14 Merge branch 'topic/modelopt' into next 2009-01-23 23:27:48 +01:00
Tim Moore
26a416399f Merge branch 'topic/yontree' into next 2009-01-23 23:27:37 +01:00