Revision: 8517
http://playerstage.svn.sourceforge.net/playerstage/?rev=8517&view=rev
Author: rtv
Date: 2010-01-19 23:07:26 +0000 (Tue, 19 Jan 2010)
Log Message:
-----------
added collision with ground (z=0 plane) using patch #2929553 from RAZOR
Modified Paths:
--------------
code/stage/trunk/libstage/block.cc
code/stage/trunk/libstage/world.cc
code/stage/trunk/worlds/fasr.world
Modified: code/stage/trunk/libstage/block.cc
===================================================================
--- code/stage/trunk/libstage/block.cc 2010-01-19 22:57:20 UTC (rev 8516)
+++ code/stage/trunk/libstage/block.cc 2010-01-19 23:07:26 UTC (rev 8517)
@@ -163,6 +163,10 @@
GenerateCandidateCells();
if( mod->vis.obstacle_return )
+ {
+ if ( global_z.min < 0 )
+ return this->mod->world->GetGround();
+
// for every cell we may be rendered into
FOR_EACH( cell_it, *candidate_cells )
{
@@ -187,6 +191,7 @@
}
}
}
+ }
//printf( "model %s block %p collision done. no hits.\n", mod->Token(), this
);
return NULL; // no hit
Modified: code/stage/trunk/libstage/world.cc
===================================================================
--- code/stage/trunk/libstage/world.cc 2010-01-19 22:57:20 UTC (rev 8516)
+++ code/stage/trunk/libstage/world.cc 2010-01-19 23:07:26 UTC (rev 8517)
@@ -146,11 +146,18 @@
pthread_cond_init( &threads_done_cond, NULL );
World::world_set.insert( this );
+
+ ground = new Model(this, NULL, "model");
+ assert(ground);
+ ground->SetToken( "_ground_model" ); // allow users to identify this unique
model
+ ground->ClearBlocks();
+ ground->SetGuiMove(false);
}
World::~World( void )
{
PRINT_DEBUG2( "destroying world %d %s", id, token.c_str() );
+ if( ground ) delete ground;
if( wf ) delete wf;
World::world_set.erase( this );
}
Modified: code/stage/trunk/worlds/fasr.world
===================================================================
--- code/stage/trunk/worlds/fasr.world 2010-01-19 22:57:20 UTC (rev 8516)
+++ code/stage/trunk/worlds/fasr.world 2010-01-19 23:07:26 UTC (rev 8517)
@@ -1,3 +1,4 @@
+
# FASR demo world
# Authors: Richard Vaughan
# $Id: fasr.world,v 1.4 2008-04-01 23:57:41 rtv Exp $
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit