2014-03-20 12:38:25 +00:00
|
|
|
{ {% for body in bodies %}
|
|
|
|
{% if not forloop.first %}, {% endif %}
|
|
|
|
"{{body.name}}": [
|
|
|
|
{% for fixture in body.fixtures %}{% if not forloop.first %} ,{% endif %}
|
|
|
|
{
|
2014-03-20 14:27:50 +00:00
|
|
|
"isSensor": {{fixture.isSensor}},
|
|
|
|
"filter": {
|
|
|
|
"categoryBits": {{fixture.filter_categoryBits}},
|
|
|
|
"maskBits": {{fixture.filter_maskBits}}
|
|
|
|
},
|
|
|
|
|
|
|
|
{% if fixture.isCircle %}
|
|
|
|
"circle": {
|
|
|
|
"radius": {{fixture.radius|floatformat:3}},
|
|
|
|
"position": [
|
|
|
|
{{fixture.center.x|floatformat:3}},
|
|
|
|
{{fixture.center.y|floatformat:3}}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
{% else %}
|
|
|
|
"polygons":[
|
|
|
|
{% for polygon in fixture.polygons %}{% if not forloop.first %} ,{% endif %}
|
|
|
|
[ {% for point in polygon %} {% if not forloop.first %}, {% endif %} {{point.x}}, {{point.y}} {% endfor %} ]
|
|
|
|
{% endfor %}
|
|
|
|
]
|
|
|
|
{% endif %}
|
2014-03-20 12:38:25 +00:00
|
|
|
}
|
|
|
|
{% endfor %}
|
|
|
|
]
|
|
|
|
{% endfor %}
|
|
|
|
}
|