Skip to content

Commit

Permalink
QP Library Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
erayzesen committed Jan 24, 2025
1 parent c9b096a commit bf48c79
Show file tree
Hide file tree
Showing 15 changed files with 2,416 additions and 54 deletions.
Binary file modified .sconsign.dblite
Binary file not shown.
3 changes: 2 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ env.Append(CPPPATH=["src/"])
env.Append(CPPPATH=["src/QuarkPhysics/"])
env.Append(CPPPATH=["src/QuarkPhysics/extensions/"])
env.Append(CPPPATH=["src/QuarkPhysics/json/"])
env.Append(CPPPATH=["src/QuarkPhysics/polypartition/"])
#env.Append(CPPPATH=[env.Dir(d) for d in source_path])
sources = [ Glob("src/*.cpp"),Glob("src/QuarkPhysics/*.cpp"),Glob("src/QuarkPhysics/extensions/*.cpp"),Glob("src/QuarkPhysics/json/*.cpp") ]
sources = [ Glob("src/*.cpp"),Glob("src/QuarkPhysics/*.cpp"),Glob("src/QuarkPhysics/extensions/*.cpp"),Glob("src/QuarkPhysics/json/*.cpp"),Glob("src/QuarkPhysics/polypartition/*.cpp") ]
#sources = Glob("src/*.cpp")


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,7 @@ func parse_tile_map() :


for polygon in collider_layer["polygons"] :
var decomp_polygons=Geometry2D.decompose_polygon_in_convex(polygon)
for decomp_poly in decomp_polygons :
for i in range(decomp_poly.size()) :
decomp_poly[i]=decomp_poly[i]*tile_map.global_scale
for decomp_poly in decomp_polygons :
create_and_add_mesh_with_cell_data(bodyNode,decomp_poly)
create_and_add_mesh_with_cell_data(bodyNode,polygon)

pass

Expand Down
2 changes: 1 addition & 1 deletion project/examples/1_welcome/main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ script = ExtResource("1_nagly")

[node name="QWorldNode" type="QWorldNode" parent="."]
gravity = Vector2(0, 0.1)
debug_renderer = false
enable_debug_mouse_interactions = true

[node name="background" type="ColorRect" parent="."]
visible = false
offset_right = 1030.0
offset_bottom = 580.0
mouse_filter = 2
Expand Down
1 change: 0 additions & 1 deletion project/examples/7_classic_platformer/main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ key w: jump
label_settings = SubResource("LabelSettings_2ckbs")

[node name="QWorldNode" type="QWorldNode" parent="."]
debug_renderer = false
enable_debug_mouse_interactions = true
script = ExtResource("4_5rs6g")

Expand Down
7 changes: 1 addition & 6 deletions src/QuarkPhysics/extensions/qplatformerbody.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ void QPlatformerBody::PostUpdate()
//Checking Floor
onFloor=false;

AddPosition(dirFloor*1.0);
AddPosition(dirFloor*1.0f);
vector<QManifold> nextFloorManifolds=world->TestCollisionWithWorld(this);
SetPosition(tempPosition);

Expand All @@ -500,11 +500,6 @@ void QPlatformerBody::PostUpdate()

float floorAngle=QVector::AngleBetweenTwoVectors(normal,upDirection);
if( abs(floorAngle)<maxFloorAngle ){
//For soft body vertical collision responses
if (collidedBody->GetBodyType()==QBody::BodyTypes::SOFT){
AddPosition(dirFloor*1.0);
manifold.Solve();
}
onFloor=true;
if(collidedBody->GetBodyType()==QBody::BodyTypes::RIGID){
QRigidBody *collidedRigidBody=static_cast<QRigidBody*>(collidedBody);
Expand Down
Loading

0 comments on commit bf48c79

Please sign in to comment.