# Copyright (c) 2007 SIEGE Development Team
# All rights reserved.
#
# This file is part of libSIEGE.
#
# This software is copyrighted work licensed under the terms of the
# 2-clause BSD license. Please consult the file "license.txt" for
# details.
#
# If you did not recieve the file with this program, please email
# Tim Chas <darkuranium@gmail.com>.

from siege.common cimport *
from space cimport *

cdef extern from "siege/physics/body.h":
    struct SGPhysicsBody:
        void* handle
        
        SGPhysicsSpace* space
        
        SGenum type
        void* data
    
    SGPhysicsBody* sgPhysicsBodyCreate(SGPhysicsSpace* space, SGenum type)
    void sgPhysicsBodyDestroy(SGPhysicsBody* body)
    
    void sgPhysicsBodySetData(SGPhysicsBody* body, void* data)
    void* sgPhysicsBodyGetData(SGPhysicsBody* body)
    
    void sgPhysicsBodySetPos(SGPhysicsBody* body, float x, float y)
    void sgPhysicsBodyGetPos(SGPhysicsBody* body, float* x, float* y)
    
    void sgPhysicsBodySetPosX(SGPhysicsBody* body, float x)
    float sgPhysicsBodyGetPosX(SGPhysicsBody* body)
    void sgPhysicsBodySetPosY(SGPhysicsBody* body, float y)
    float sgPhysicsBodyGetPosY(SGPhysicsBody* body)
    
    void sgPhysicsBodySetAngleRads(SGPhysicsBody* body, float rads)
    float sgPhysicsBodyGetAngleRads(SGPhysicsBody* body)
    void sgPhysicsBodySetAngleDegs(SGPhysicsBody* body, float degs)
    float sgPhysicsBodyGetAngleDegs(SGPhysicsBody* body)
    
    void sgPhysicsBodySetVel(SGPhysicsBody* body, float x, float y)
    void sgPhysicsBodyGetVel(SGPhysicsBody* body, float* x, float* y)
    
    void sgPhysicsBodySetVelX(SGPhysicsBody* body, float x)
    float sgPhysicsBodyGetVelX(SGPhysicsBody* body)
    void sgPhysicsBodySetVelY(SGPhysicsBody* body, float y)
    float sgPhysicsBodyGetVelY(SGPhysicsBody* body)
    
    void sgPhysicsBodySetAngVelRads(SGPhysicsBody* body, float rads)
    float sgPhysicsBodyGetAngVelRads(SGPhysicsBody* body)
    void sgPhysicsBodySetAngVelDegs(SGPhysicsBody* body, float degs)
    float sgPhysicsBodyGetAngVelDegs(SGPhysicsBody* body)
    
    void sgPhysicsBodySetMass(SGPhysicsBody* body, float mass)
    float sgPhysicsBodyGetMass(SGPhysicsBody* body)
    
    void sgPhysicsBodySetMoment(SGPhysicsBody* body, float moment)
    float sgPhysicsBodyGetMoment(SGPhysicsBody* body)

cdef class Body:
    cdef SGPhysicsBody* handle
    cdef object pydata
    
    cpdef destroy(self)
