VoltAir
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Groups
Pages
Engine
Joints.h
1
/*
2
* Copyright (C) 2014 Google Inc.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#ifndef JOINTS_H
18
#define JOINTS_H
19
20
#include <QObject>
21
22
class
Body
;
23
class
RevoluteJoint
;
24
class
WeldJoint
;
25
30
class
Joints
:
public
QObject
{
31
Q_OBJECT
32
public
:
33
39
Q_INVOKABLE
RevoluteJoint
*
createRevoluteJoint
(
Body
* joiner,
Body
* joinee);
40
47
Q_INVOKABLE
WeldJoint
*
createWeldJoint
(
Body
* joiner,
Body
* joinee);
48
52
static
Joints
*
getInstance
();
53
private
:
54
Joints
(
QObject
*
parent
=
nullptr
);
55
56
static
Joints
* sInstance;
57
};
58
Q_DECLARE_METATYPE(
Joints
*)
59
60
#endif // JOINTS_H
Body
A QObject container for a Box2D b2Body.
Definition:
Body.h:57
RevoluteJoint
A constraint that fixes the distance between each Bodys anchor point.
Definition:
RevoluteJoint.h:27
Joints::getInstance
static Joints * getInstance()
Returns the Joints singleton.
Joints::createWeldJoint
Q_INVOKABLE WeldJoint * createWeldJoint(Body *joiner, Body *joinee)
Creates a WeldJoint.
QObject
Joints
Factory class for creating Joints from QML.
Definition:
Joints.h:30
Joints::createRevoluteJoint
Q_INVOKABLE RevoluteJoint * createRevoluteJoint(Body *joiner, Body *joinee)
Creates a RevoluteJoint.
WeldJoint
A constraint that fixes the relative positions of two Bodys.
Definition:
WeldJoint.h:26
QObject::parent
QObject * parent() const