Sha256: 715d87cdfb485ac307eb4886a1485f33fc293a4b0dae01a2241ad61931ba8c5e

Contents?: true

Size: 1.56 KB

Versions: 3

Compression:

Stored size: 1.56 KB

Contents

// -*- c++ -*-
#pragma once
#ifndef __REFLEX_SRC_BODY_H__
#define __REFLEX_SRC_BODY_H__


#include <xot/noncopyable.h>
#include <xot/pimpl.h>
#include <rays/point.h>
#include <reflex/defs.h>


class b2Body;


namespace Reflex
{


	class World;


	class Body : public Xot::NonCopyable
	{

		public:

			Body (World* world, const Point& position = 0, float angle = 0);

			~Body ();

			void apply_force (coord x, coord y);

			void apply_force (const Point& force);

			void apply_torque (float torque);

			void apply_linear_impulse (coord x, coord y);

			void apply_linear_impulse (const Point& impulse);

			void apply_angular_impulse (float impulse);

			void awake ();

			float meter2pixel (float meter = 1) const;

			void set_transform (coord x, coord y, float degree);

			void set_transform (const Point& position, float degree);

			Point position () const;

			float angle () const;

			void set_dynamic (bool dynamic = true);

			bool  is_dynamic () const;

			void set_linear_velocity (coord x, coord y);

			void set_linear_velocity (const Point& velocity);

			Point    linear_velocity () const;

			void set_angular_velocity (float velocity);

			float    angular_velocity () const;

			void set_gravity_scale (float scale);

			float    gravity_scale () const;

			struct Data;

			Xot::PImpl<Data> self;

	};// Body


	void Body_copy_attributes (Body* to, const Body& from);

	Body* Body_create_temporary ();

	bool Body_is_temporary (const Body& body);

	      b2Body* Body_get_b2ptr (      Body* body);

	const b2Body* Body_get_b2ptr (const Body* body);


}// Reflex


#endif//EOH

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
reflexion-0.1.38 src/body.h
reflexion-0.1.37 src/body.h
reflexion-0.1.36 src/body.h