Class ODE::HashSpace
In: ext/body.c  (CVS)
Parent: ODE::Space

Methods

Public Class methods

ODE::Space Singleton allocator

[Source]

/*
 * ODE::Space Singleton allocator
 */
static VALUE
ode_space_s_alloc( klass )
	 VALUE klass;
{
	debugMsg(( "Wrapping an uninitialized ODE::Space ptr." ));
	return Data_Wrap_Struct( klass, ode_space_gc_mark, ode_space_gc_free, 0 );
}

Public Instance methods

setLevels( minlevel, maxlevel ) — Set some parameters for a multi-resolution hash table space. The smallest and largest cell sizes used in the hash table will be 2^minlevel and 2^maxlevel respectively. The value of minlevel must be less than or equal to the value of maxlevel.

[Source]

/*
 * setLevels( minlevel, maxlevel )
 * --
 * Set some parameters for a multi-resolution hash table space. The smallest and
 * largest cell sizes used in the hash table will be 2^minlevel and 2^maxlevel
 * respectively. The value of minlevel must be less than or equal to the value
 * of maxlevel.
 */
static VALUE
ode_hashspace_set_levels( self, minlevel, maxlevel )
	 VALUE self, minlevel, maxlevel;
{
	ode_GEOMETRY *ptr = get_space( self );
	int min = NUM2INT(minlevel), max = NUM2INT(maxlevel);

	if ( min > max )
		rb_raise( rb_eRangeError, "Min may not be greater than max." );

	dHashSpaceSetLevels( (dSpaceID)ptr->id, min, max );

	return rb_ary_new3( 2, INT2FIX(min), INT2FIX(max) );
}

[Validate]