Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
b6e12ca9
Commit
b6e12ca9
authored
Oct 06, 2015
by
Viktor Lidholt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Forwards physics body properties to box2d in sprite physics
parent
5ac4d1ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
10 deletions
+72
-10
physics_body.dart
packages/flutter_sprites/lib/physics_body.dart
+72
-10
No files found.
packages/flutter_sprites/lib/physics_body.dart
View file @
b6e12ca9
...
...
@@ -17,11 +17,11 @@ class PhysicsBody {
double
angularVelocity:
0.0
,
this
.
linearDampening
:
0.0
,
double
awakeangularDampening:
0.0
,
this
.
allowSleep
:
true
,
this
.
awake
:
true
,
this
.
fixedRotation
:
false
,
this
.
bullet
:
false
,
this
.
active
:
true
,
bool
allowSleep:
true
,
bool
awake:
true
,
bool
fixedRotation:
false
,
bool
bullet:
false
,
bool
active:
true
,
this
.
gravityScale
:
1.0
})
{
this
.
density
=
density
;
...
...
@@ -32,6 +32,12 @@ class PhysicsBody {
this
.
linearVelocity
=
linearVelocity
;
this
.
angularVelocity
=
angularVelocity
;
this
.
angularDampening
=
angularDampening
;
this
.
allowSleep
=
allowSleep
;
this
.
awake
=
awake
;
this
.
fixedRotation
=
fixedRotation
;
this
.
bullet
=
bullet
;
this
.
active
=
active
;
}
Object
tag
;
...
...
@@ -151,15 +157,71 @@ class PhysicsBody {
_body
.
angularDamping
=
angularDampening
;
}
bool
allowSleep
;
bool
_allowSleep
;
bool
get
allowSleep
=>
_allowSleep
;
set
allowSleep
(
bool
allowSleep
)
{
_allowSleep
=
allowSleep
;
bool
awake
;
if
(
_body
!=
null
)
_body
.
setSleepingAllowed
(
allowSleep
);
}
bool
fixedRotation
;
bool
_awake
;
bool
get
awake
{
if
(
_body
!=
null
)
return
_body
.
isAwake
();
else
return
_awake
;
}
bool
bullet
;
set
awake
(
bool
awake
)
{
_awake
=
awake
;
bool
active
;
if
(
_body
!=
null
)
_body
.
setAwake
(
awake
);
}
bool
_fixedRotation
;
bool
get
fixedRotation
=>
_fixedRotation
;
set
fixedRotation
(
bool
fixedRotation
)
{
_fixedRotation
=
fixedRotation
;
if
(
_body
!=
null
)
_body
.
setFixedRotation
(
fixedRotation
);
}
bool
_bullet
;
bool
get
bullet
=>
_bullet
;
set
bullet
(
bool
bullet
)
{
_bullet
=
bullet
;
if
(
_body
!=
null
)
{
_body
.
setBullet
(
bullet
);
}
}
bool
_active
;
bool
get
active
{
if
(
_body
!=
null
)
return
_body
.
isActive
();
else
return
_active
;
}
set
active
(
bool
active
)
{
_active
=
active
;
if
(
_body
!=
null
)
_body
.
setActive
(
active
);
}
double
gravityScale
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment