Example #1
0
keep_aspect_doc[] = ".. py:attribute:: keep_aspect\n"
"\n"
"    keep the aspect to the original size of the texture instead of the screen\n";
PYSOY_PROP_BOOL(widgets, canvas, keep_aspect);

static char
rotation_doc[] = ".. py:attribute:: rotation\n"
"\n"
"    rotation of the Canvas, defaults to 0\n";
PYSOY_PROP_FLOAT(widgets, canvas, rotation);

///////////////////////////////////////////////////////////////////////////////
// Type structs

static PyGetSetDef tp_getset[] = {
    PYSOY_PROPSTRUCT(texture),
    PYSOY_PROPSTRUCT(x),
    PYSOY_PROPSTRUCT(y),
    PYSOY_PROPSTRUCT(scaleX),
    PYSOY_PROPSTRUCT(scaleY),
    PYSOY_PROPSTRUCT(keep_aspect),
    PYSOY_PROPSTRUCT(align),
    PYSOY_PROPSTRUCT(rotation),
    {NULL},                                                // sentinel
};


PyTypeObject PySoy_widgets_Canvas_Type = {
    PyVarObject_HEAD_INIT(NULL, 0)
    "soy.widgets.Canvas",                                  // tp_name
    sizeof(PySoy_widgets_Canvas_Object),                   // tp_basicsize
Example #2
0
File: Hinge.c Project: RONNCC/pysoy
///////////////////////////////////////////////////////////////////////////////
// Properties
static char anchor_doc[] =
"where the joint is anchored, returns a :class:`~soy.atoms.Position`";
PYSOY_PROP_OBJECT_OWNED(joints, hinge, anchor, atoms_Position);

static char axis_doc[] = "axis of rotation for the hinge, returns a :class:`~soy.atoms.Axis`";
PYSOY_PROP_OBJECT_OWNED(joints, hinge, axis, atoms_Axis);


///////////////////////////////////////////////////////////////////////////////
// Type structs

static PyGetSetDef tp_getset[] = {
    PYSOY_PROPSTRUCT(anchor),
    PYSOY_PROPSTRUCT(axis),
    {NULL},                         // sentinel
};

PyTypeObject PySoy_joints_Hinge_Type = {
    PyVarObject_HEAD_INIT(NULL, 0)
    "soy.joints.Hinge",                                     // tp_name
    sizeof(PySoy_joints_Hinge_Object),                      // tp_basicsize
    0,                                                     // tp_itemsize
    0,                                                     // tp_dealloc
    0,                                                     // tp_print
    (getattrfunc) 0,                                       // tp_getattr
    (setattrfunc) 0,                                       // tp_setattr
    0,                                                     // tp_compare
    (reprfunc) tp_repr,                                    // tp_repr
Example #3
0
}


///////////////////////////////////////////////////////////////////////////////
// Properties

static char
position_doc[] = "Pointer position inside window";
PYSOY_PROP_OBJECT_OWNED(controllers, pointer, position, atoms_Position)


///////////////////////////////////////////////////////////////////////////////
// Type structs

static PyGetSetDef tp_getset[] = {
    PYSOY_PROPSTRUCT(position),
    {NULL},                                                // sentinel
};


PyTypeObject PySoy_controllers_Pointer_Type = {
    PyVarObject_HEAD_INIT(NULL, 0)
    "soy.controllers.Pointer",                             // tp_name
    sizeof(PySoy_controllers_Pointer_Object),              // tp_basicsize
    0,                                                     // tp_itemsize
    0,                                                     // tp_dealloc
    0,                                                     // tp_print
    (getattrfunc) 0,                                       // tp_getattr
    (setattrfunc) 0,                                       // tp_setattr
    0,                                                     // tp_compare
    (reprfunc) tp_repr,                                    // tp_repr
Example #4
0
File: Face.c Project: RONNCC/pysoy
// Properties

static char
material_doc[] = "soy.materials.Material\n"
"\n"
"   This is the material with which the face is rendered.\n"
"\n";
// TODO expand this, example, etc
PYSOY_PROP_OBJECT(atoms, face, material, materials_Material)


///////////////////////////////////////////////////////////////////////////////
// Type structs

static PyGetSetDef tp_getset[] = {
    PYSOY_PROPSTRUCT(material),
    {NULL},                                                // sentinel
};


static PySequenceMethods tp_as_sequence = {
    (lenfunc) sq_length,                                   // sq_length
    0,                                                     // sq_concat
    0,                                                     // sq_repeat
    (ssizeargfunc) sq_item,                                // sq_item
    0,                                                     // was_sq_slice
    (ssizeobjargproc) sq_ass_item,                         // sq_ass_item
    0,                                                     // was_sq_ass_slice
    0,                                                     // sq_contains
    0,                                                     // sq_inplace_concat
    0,                                                     // sq_inplace_repeat
Example #5
0
static char axis2_doc[] = ".. py:attribute:: Piston.axis2\n"
                          "\n"
                          "    The :class:`~soy.atoms.Axis` of the piston's second pin.\n"
                          "\n"
                          "    When connected to two bodies this will float respective both bodies,\n"
                          "    while when connecting a body to its scene this will remain fixed.\n"
                          "\n";
PYSOY_PROP_OBJECT_OWNED(joints, piston, axis2, atoms_Axis);


///////////////////////////////////////////////////////////////////////////////
// Type structs

static PyGetSetDef tp_getset[] = {
    PYSOY_PROPSTRUCT(anchor),
    PYSOY_PROPSTRUCT(angle),
    PYSOY_PROPSTRUCT(axis1),
    PYSOY_PROPSTRUCT(axis2),
    PYSOY_PROPSTRUCT(length),
    {NULL},                                                // sentinel
};


PyTypeObject PySoy_joints_Piston_Type = {
    PyVarObject_HEAD_INIT(NULL, 0)
    "soy.joints.Piston",                                   // tp_name
    sizeof(PySoy_joints_Piston_Object),                    // tp_basicsize
    0,                                                     // tp_itemsize
    0,                                                     // tp_dealloc
    0,                                                     // tp_print
Example #6
0
"\n";
PYSOY_PROP_FLOAT(bodies, box, radius);

static char
size_doc[] = "..py:attribute:: Size(size) \n"
"\n"
":param size: Box size \n"
":type size: soy.atoms.Size \n";
PYSOY_PROP_OBJECT_OWNED(bodies, box, size, atoms_Size);


///////////////////////////////////////////////////////////////////////////////
// Type structs

static PyGetSetDef tp_getset[] = {
    PYSOY_PROPSTRUCT(material),
    PYSOY_PROPSTRUCT(radius),
    PYSOY_PROPSTRUCT(size),
    {NULL}                                                  // sentinel
};


PyTypeObject PySoy_bodies_Box_Type = {
    PyVarObject_HEAD_INIT(NULL, 0)
    "soy.bodies.Box",                                      // tp_name
    sizeof(PySoy_bodies_Box_Object),                       // tp_basicsize
    0,                                                     // tp_itemsize
    0,                                                     // tp_dealloc
    0,                                                     // tp_print
    (getattrfunc) 0,                                       // tp_getattr
    (setattrfunc) 0,                                       // tp_setattr
Example #7
0
    return ret;
}

///////////////////////////////////////////////////////////////////////////////
// Properties
//

static char
viscosity_doc[] = "Viscosity of the buoyant field";
PYSOY_PROP_FLOAT(fields, buoyancy, viscosity);

///////////////////////////////////////////////////////////////////////////////
// Type structs

static PyGetSetDef tp_getset[] = {
    PYSOY_PROPSTRUCT(viscosity),
    {NULL},                     // sentinel
};

PyTypeObject PySoy_fields_Buoyancy_Type = {
    PyVarObject_HEAD_INIT(NULL, 0)
    "soy.fields.Buoyancy",                                 // tp_name
    sizeof(PySoy_fields_Buoyancy_Object),                // tp_basicsize
    0,                                                     // tp_itemsize
    0,                                                     // tp_dealloc
    0,                                                     // tp_print
    (getattrfunc) 0,                                       // tp_getattr
    (setattrfunc) 0,                                       // tp_setattr
    0,                                                     // RESERVED
    (reprfunc) tp_repr,                                    // tp_repr
    0,                                                     // tp_as_number
Example #8
0
File: Area.c Project: RONNCC/pysoy
static char
x2_doc[] = "Second x-coordinate";
PYSOY_PROP_FLOAT(atoms, area, x2);


static char
y2_doc[] = "Second y-coordinate";
PYSOY_PROP_FLOAT(atoms, area, y2);


///////////////////////////////////////////////////////////////////////////////
// Type structs

static PyGetSetDef tp_getset[] = {
	PYSOY_PROPSTRUCT(x1),
	PYSOY_PROPSTRUCT(y1),
	PYSOY_PROPSTRUCT(x2),
	PYSOY_PROPSTRUCT(y2),
	{NULL},                                                 // sentinel
};


PyTypeObject PySoy_atoms_Area_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	"soy.atoms.Area",                                      // tp_name
	sizeof(PySoy_atoms_Area_Object),                       // tp_basicsize
	0,                                                     // tp_itemsize
	0,                                                     // tp_dealloc
	0,                                                     // tp_print
	(getattrfunc) 0,                                       // tp_getattr
Example #9
0
// Properties
static char anchor_doc[] = ".. py:attribute:: Ball.anchor\n"
"\n"
"    The :class:`~soy.atoms.Position` of the joint's ball/socket.\n"
"\n"
"    When connected to two bodies this will float respective both bodies,\n"
"    but when connecting a body to its scene this will remain fixed.\n"
"\n";
PYSOY_PROP_OBJECT_OWNED(joints, ball, anchor, atoms_Position);


///////////////////////////////////////////////////////////////////////////////
// Type structs

static PyGetSetDef tp_getset[] = {
    PYSOY_PROPSTRUCT(anchor),
    {NULL},                                                // sentinel
};


PyTypeObject PySoy_joints_Ball_Type = {
    PyVarObject_HEAD_INIT(NULL, 0)
    "soy.joints.Ball",                                     // tp_name
    sizeof(PySoy_joints_Ball_Object),                      // tp_basicsize
    0,                                                     // tp_itemsize
    0,                                                     // tp_dealloc
    0,                                                     // tp_print
    (getattrfunc) 0,                                       // tp_getattr
    (setattrfunc) 0,                                       // tp_setattr
    0,                                                     // RESERVED
    (reprfunc) tp_repr,                                    // tp_repr
Example #10
0
static char 
finished_doc[] = "Whether or not the controller is finished";
PYSOY_PROP_BOOL_RO(controllers, virtual_controller, finished);
#define finished_setter NULL

static char
registered_doc[] = "Whether or not this controller is registered with scene";
PYSOY_PROP_BOOL(controllers, virtual_controller, registered);

static PyMethodDef tp_methods[] = {
    {NULL, NULL}
};

static PyGetSetDef tp_getset[] = {
    PYSOY_PROPSTRUCT(finished),
    PYSOY_PROPSTRUCT(registered),
    {NULL}
};


PyTypeObject PySoy_controllers_VirtualController_Type = {
    PyVarObject_HEAD_INIT(NULL, 0)
    "soy.controllers.VirtualController",                   // tp_name
    sizeof(PySoy_controllers_VirtualController_Object),    // tp_basicsize
    0,                                                     // tp_itemsize
    0,                                                     // tp_dealloc
    0,                                                     // tp_print
    (getattrfunc) 0,                                       // tp_getattr
    (setattrfunc) 0,                                       // tp_setattr
    0,                                                     // tp_compare
Example #11
0
///////////////////////////////////////////////////////////////////////////////
// Properties

PYSOY_PROP_OBJECT(widgets, widget, size, atoms_Size)
static char
size_doc[] = ".. py:attribute:: size \n"
"\n"
"Window size \n"
"\n";


///////////////////////////////////////////////////////////////////////////////
// Type structs

static PyGetSetDef tp_getset[] = {
    PYSOY_PROPSTRUCT(size),
    {NULL},                                                // sentinel
};


PyTypeObject PySoy_widgets_Widget_Type = {
    PyVarObject_HEAD_INIT(NULL, 0)
    "soy.widgets.Widget",                                  // tp_name
    sizeof(PySoy_widgets_Widget_Object),                   // tp_basicsize
    0,                                                     // tp_itemsize
    0,                                                     // tp_dealloc
    0,                                                     // tp_print
    (getattrfunc) 0,                                       // tp_getattr
    (setattrfunc) 0,                                       // tp_setattr
    0,                                                     // RESERVED
    (reprfunc) tp_repr,                                    // tp_repr
Example #12
0
///////////////////////////////////////////////////////////////////////////////
// Properties
static char length_doc[] = "length of the slider, cannot be set, returns a float";
PYSOY_PROP_FLOAT_RO(joints, slider, length);
#define length_setter NULL

static char axis_doc[] =
"connecting axis between objects, returns a :class:`~soy.atoms.Axis`";
PYSOY_PROP_OBJECT_OWNED(joints, slider, axis, atoms_Axis);

///////////////////////////////////////////////////////////////////////////////
// Type structs

static PyGetSetDef tp_getset[] = {
    PYSOY_PROPSTRUCT(length),
    PYSOY_PROPSTRUCT(axis),
    {NULL},                         // sentinel
};

PyTypeObject PySoy_joints_Slider_Type = {
    PyVarObject_HEAD_INIT(NULL, 0)
    "soy.joints.Slider",                                     // tp_name
    sizeof(PySoy_joints_Slider_Object),                      // tp_basicsize
    0,                                                     // tp_itemsize
    0,                                                     // tp_dealloc
    0,                                                     // tp_print
    (getattrfunc) 0,                                       // tp_getattr
    (setattrfunc) 0,                                       // tp_setattr
    0,                                                     // tp_compare
    (reprfunc) tp_repr,                                    // tp_repr
Example #13
0
static char
material_doc[] = ".. py:attribute:: material\n"
"\n"
"    This :py:class:`~soy.materials.Material` is used to render the floor.\n";
PYSOY_PROP_OBJECT(scenes, planar, material, materials_Material)

static char
scale_doc[] = "Texcoord Scale";
PYSOY_PROP_FLOAT(scenes, planar, scale);

///////////////////////////////////////////////////////////////////////////////
// Type structs

static PyGetSetDef tp_getset[] = {
    PYSOY_PROPSTRUCT(material),
    PYSOY_PROPSTRUCT(scale),
    {NULL},                                                // sentinel
};


PyTypeObject PySoy_scenes_Planar_Type = {
    PyVarObject_HEAD_INIT(NULL, 0)
    "soy.scenes.Planar",                                   // tp_name
    sizeof(PySoy_scenes_Planar_Object),                    // tp_basicsize
    0,                                                     // tp_itemsize
    0,                                                     // tp_dealloc
    0,                                                     // tp_print
    (getattrfunc) 0,                                       // tp_getattr
    (setattrfunc) 0,                                       // tp_setattr
    0,                                                     // RESERVED
Example #14
0
static PySequenceMethods tp_as_sequence = {
    (lenfunc) sq_length,                                   // sq_length
    0,                                                     // sq_concat
    0,                                                     // sq_repeat
    (ssizeargfunc) sq_item,                                // sq_item
    0,                                                     // was_sq_slice
    (ssizeobjargproc) sq_ass_item,                         // sq_ass_item
    0,                                                     // was_sq_ass_slice
    0,                                                     // sq_contains
    0,                                                     // sq_inplace_concat
    0,                                                     // sq_inplace_repeat
};

static PyGetSetDef tp_getset[] = {
    PYSOY_PROPSTRUCT(channels),
    {NULL},                                                // sentinel
};


PyTypeObject PySoy_textures_Bumpmap_Type = {
    PyVarObject_HEAD_INIT(NULL, 0)
    "soy.textures.Bumpmap",                                // tp_name
    sizeof(PySoy_textures_Bumpmap_Object),                 // tp_basicsize
    0,                                                     // tp_itemsize
    0,                                                     // tp_dealloc
    0,                                                     // tp_print
    (getattrfunc) 0,                                       // tp_getattr
    (setattrfunc) 0,                                       // tp_setattr
    0,                                                     // RESERVED
    (reprfunc) tp_repr,                                    // tp_repr
Example #15
0
File: Morph.c Project: RONNCC/pysoy
PYSOY_PROP_FLOAT(atoms, morph, delta);
static char
delta_doc[] = "Delta ratio for morph"
"\n"
"   A Morph atom is a matrix of vertex transformations that will be added to a Mesh.\n"
"   Each element of the matrix is multiplied by the delta ratio before being added."
"\n"
;


///////////////////////////////////////////////////////////////////////////////
// Type structs

static PyGetSetDef tp_getset[] = {
    PYSOY_PROPSTRUCT(delta),
    {NULL},                                                // sentinel
};


PyTypeObject PySoy_atoms_Morph_Type = {
    PyVarObject_HEAD_INIT(NULL, 0)
    "soy.atoms.Morph",                                     // tp_name
    sizeof(PySoy_atoms_Morph_Object),                      // tp_basicsize
    0,                                                     // tp_itemsize
    0,                                                     // tp_dealloc
    0,                                                     // tp_print
    (getattrfunc) 0,                                       // tp_getattr
    (setattrfunc) 0,                                       // tp_setattr
    0,                                                     // tp_compare
    (reprfunc) tp_repr,                                    // tp_repr
Example #16
0
PYSOY_PROP_OBJECT_OWNED(atoms, vertex, texcoord, atoms_Position)


static char
tangent_doc[] = ".. py:attribute:: tangent\n"
"\n"
"    :class:`soy.atoms.Vector` that represents the tangent vector\n"
"\n";
PYSOY_PROP_OBJECT_OWNED(atoms, vertex, tangent, atoms_Vector)


///////////////////////////////////////////////////////////////////////////////
// Type structs

static PyGetSetDef tp_getset[] = {
    PYSOY_PROPSTRUCT(position),
    PYSOY_PROPSTRUCT(normal),
    PYSOY_PROPSTRUCT(texcoord),
    PYSOY_PROPSTRUCT(tangent),
    {NULL},                                                // sentinel
};


PyTypeObject PySoy_atoms_Vertex_Type = {
    PyVarObject_HEAD_INIT(NULL, 0)
    "soy.atoms.Vertex",                                    // tp_name
    sizeof(PySoy_atoms_Vertex_Object),                     // tp_basicsize
    0,                                                     // tp_itemsize
    0,                                                     // tp_dealloc
    0,                                                     // tp_print
    (getattrfunc) 0,                                       // tp_getattr
Example #17
0
    0,                                                     // nb_inplace_or
    0,                                                     // nb_floor_divide
    0,                                                     // nb_true_divide
    0,                                                     // nb_inplace_floo..
    0,                                                     // nb_inplace_true..
    0,                                                     // nb_index
};


static PyMethodDef tp_methods[] = {
    {NULL},                                                // sentinel
};


static PyGetSetDef tp_getset[] = {
    PYSOY_PROPSTRUCT(background),
    PYSOY_PROPSTRUCT(position),
    PYSOY_PROPSTRUCT(size),
    PYSOY_PROPSTRUCT(title),
    PYSOY_PROPSTRUCT(fps),
    PYSOY_PROPSTRUCT(__windowid__),
    PYSOY_PROPSTRUCT(resizable),
    {NULL},                                                // sentinel
};


PyTypeObject PySoy_widgets_Window_Type = {
    PyVarObject_HEAD_INIT(NULL, 0)
    "soy.widgets.Window",                                  // tp_name
    sizeof(PySoy_widgets_Window_Object),                   // tp_basicsize
    0,                                                     // tp_itemsize