3DCoat Python API
The 3DCoat Python API documentation.
Loading...
Searching...
No Matches
coat.SphericalCollision Class Reference

Public Member Functions

 __init__ (self)
 
 __init__ (self, float cellsize)
 
 __init__ (self)
 
 setUnit (self, float u)
 set the cell size, the cell space should be empty
 
 clear (self)
 remove all spheres
 
int addSphere (self, vec3 p, float radius)
 add the sphere into the space
 
vec3 collides (self, vec3 p, float radius)
 check if sphere intersects other spheres in the space
 
vec4 sphere (self, int idx)
 get the sphere parameters by index
 

Constructor & Destructor Documentation

◆ __init__() [1/3]

coat.SphericalCollision.__init__ ( self)

◆ __init__() [2/3]

coat.SphericalCollision.__init__ ( self,
float cellsize )

◆ __init__() [3/3]

coat.SphericalCollision.__init__ ( self)

Member Function Documentation

◆ addSphere()

int coat.SphericalCollision.addSphere ( self,
vec3 p,
float radius )

add the sphere into the space

Parameters
pthe position
radiusthe radius
Returns
the sphere index, you may refer it later using the spher(index) function

◆ clear()

coat.SphericalCollision.clear ( self)

remove all spheres

◆ collides()

vec3 coat.SphericalCollision.collides ( self,
vec3 p,
float radius )

check if sphere intersects other spheres in the space

Parameters
pposition
radiusradius
Returns
the repelling force, it is zero if no collision happened.

◆ setUnit()

coat.SphericalCollision.setUnit ( self,
float u )

set the cell size, the cell space should be empty

Parameters
uthe cell size that should be approximately around the average sphere size

◆ sphere()

vec4 coat.SphericalCollision.sphere ( self,
int idx )

get the sphere parameters by index

Parameters
idxthe sphere index (previously returned by addSphere)
Returns
the position (xyz) and radius (w) as vec4

The documentation for this class was generated from the following file: