Esempio n. 1
0
bool physics_shape_get_sensor(Entity ent,
                              unsigned int i)
{
    PhysicsInfo *info = entitypool_get(pool, ent);
    error_assert(info);
    return cpShapeGetSensor(_get_shape(info, i)->shape);
}
static cpSpaceDebugColor ColorForShape(cpShape *shape, cpDataPointer data)
{
    if(cpShapeGetSensor(shape)){
        return LAColor(1.0f, 0.3f);
    } else {
        cpBody *body = cpShapeGetBody(shape);
        
        if(cpBodyIsSleeping(body)){
            return LAColor(0.2f, 0.3f);
        } else if(body->sleeping.idleTime > shape->space->sleepTimeThreshold) {
            return LAColor(0.66f, 0.3f);
        } else {
            
            GLfloat intensity = (cpBodyGetType(body) == CP_BODY_TYPE_STATIC ? 0.15f : 0.75f);
            return RGBAColor(intensity, 0.0f, 0.0f, 0.3f);
        }
    }
}
bool CCPhysicsShape::isSensor(void)
{
    return cpShapeGetSensor(m_shape);
}
Esempio n. 4
0
bool worldShape_collides(WorldShape_t *aShape)
{
    return cpShapeGetSensor(aShape->cpShape);
}
		bool shape::sensor( void ) {	return (cpShapeGetSensor( this->m_shape ) == cpTrue) ? true : false;	}