Vec2 physics_shape_get_surface_velocity(Entity ent, unsigned int i) { PhysicsInfo *info = entitypool_get(pool, ent); error_assert(info); return vec2_of_cpv(cpShapeGetSurfaceVelocity(_get_shape(info, i)->shape)); }
void RigidBody2D::CopyShapeData(cpShape* from, cpShape* to) { cpShapeSetElasticity(to, cpShapeGetElasticity(from)); cpShapeSetFriction(to, cpShapeGetFriction(from)); cpShapeSetSurfaceVelocity(to, cpShapeGetSurfaceVelocity(from)); }
Vector2f Nz::RigidBody2D::GetSurfaceVelocity(std::size_t shapeIndex) const { assert(shapeIndex < m_shapes.size()); cpVect vel = cpShapeGetSurfaceVelocity(m_shapes[shapeIndex]); return Vector2f(static_cast<float>(vel.x), static_cast<float>(vel.y)); }
cpVect shape::surfaceVelocity( void ) { return cpShapeGetSurfaceVelocity( this->m_shape ); }