godot/modules/godot_physics_3d/godot_soft_body_3d.cpp

/**************************************************************************/
/*  godot_soft_body_3d.cpp                                                */
/**************************************************************************/
/*                         This file is part of:                          */
/*                             GODOT ENGINE                               */
/*                        https://godotengine.org                         */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.                  */
/*                                                                        */
/* Permission is hereby granted, free of charge, to any person obtaining  */
/* a copy of this software and associated documentation files (the        */
/* "Software"), to deal in the Software without restriction, including    */
/* without limitation the rights to use, copy, modify, merge, publish,    */
/* distribute, sublicense, and/or sell copies of the Software, and to     */
/* permit persons to whom the Software is furnished to do so, subject to  */
/* the following conditions:                                              */
/*                                                                        */
/* The above copyright notice and this permission notice shall be         */
/* included in all copies or substantial portions of the Software.        */
/*                                                                        */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,        */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF     */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY   */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,   */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE      */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                 */
/**************************************************************************/

#include "godot_soft_body_3d.h"

#include "godot_space_3d.h"

#include "core/math/geometry_3d.h"
#include "core/templates/rb_map.h"
#include "servers/rendering_server.h"

// Based on Bullet soft body.

/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
///btSoftBody implementation by Nathanael Presson

GodotSoftBody3D::GodotSoftBody3D() :{}

void GodotSoftBody3D::_shapes_changed() {}

void GodotSoftBody3D::set_state(PhysicsServer3D::BodyState p_state, const Variant &p_variant) {}

Variant GodotSoftBody3D::get_state(PhysicsServer3D::BodyState p_state) const {}

void GodotSoftBody3D::set_space(GodotSpace3D *p_space) {}

void GodotSoftBody3D::set_mesh(RID p_mesh) {}

void GodotSoftBody3D::update_rendering_server(PhysicsServer3DRenderingServerHandler *p_rendering_server_handler) {}

void GodotSoftBody3D::update_normals_and_centroids() {}

void GodotSoftBody3D::update_bounds() {}

void GodotSoftBody3D::update_constants() {}

void GodotSoftBody3D::update_area() {}

void GodotSoftBody3D::reset_link_rest_lengths() {}

void GodotSoftBody3D::update_link_constants() {}

void GodotSoftBody3D::apply_nodes_transform(const Transform3D &p_transform) {}

Vector3 GodotSoftBody3D::get_vertex_position(int p_index) const {}

void GodotSoftBody3D::set_vertex_position(int p_index, const Vector3 &p_position) {}

void GodotSoftBody3D::pin_vertex(int p_index) {}

void GodotSoftBody3D::unpin_vertex(int p_index) {}

void GodotSoftBody3D::unpin_all_vertices() {}

bool GodotSoftBody3D::is_vertex_pinned(int p_index) const {}

uint32_t GodotSoftBody3D::get_node_count() const {}

real_t GodotSoftBody3D::get_node_inv_mass(uint32_t p_node_index) const {}

Vector3 GodotSoftBody3D::get_node_position(uint32_t p_node_index) const {}

Vector3 GodotSoftBody3D::get_node_velocity(uint32_t p_node_index) const {}

Vector3 GodotSoftBody3D::get_node_biased_velocity(uint32_t p_node_index) const {}

void GodotSoftBody3D::apply_node_impulse(uint32_t p_node_index, const Vector3 &p_impulse) {}

void GodotSoftBody3D::apply_node_bias_impulse(uint32_t p_node_index, const Vector3 &p_impulse) {}

uint32_t GodotSoftBody3D::get_face_count() const {}

void GodotSoftBody3D::get_face_points(uint32_t p_face_index, Vector3 &r_point_1, Vector3 &r_point_2, Vector3 &r_point_3) const {}

Vector3 GodotSoftBody3D::get_face_normal(uint32_t p_face_index) const {}

bool GodotSoftBody3D::create_from_trimesh(const Vector<int> &p_indices, const Vector<Vector3> &p_vertices) {}

void GodotSoftBody3D::generate_bending_constraints(int p_distance) {}

//===================================================================
//
//
// This function takes in a list of interdependent Links and tries
// to maximize the distance between calculation
// of dependent links. This increases the amount of parallelism that can
// be exploited by out-of-order instruction processors with large but
// (inevitably) finite instruction windows.
//
//===================================================================

// A small structure to track lists of dependent link calculations.
class LinkDeps {};
LinkDepsPtr;

void GodotSoftBody3D::reoptimize_link_order() {}

void GodotSoftBody3D::append_link(uint32_t p_node1, uint32_t p_node2) {}

void GodotSoftBody3D::append_face(uint32_t p_node1, uint32_t p_node2, uint32_t p_node3) {}

void GodotSoftBody3D::set_iteration_count(int p_val) {}

void GodotSoftBody3D::set_total_mass(real_t p_val) {}

void GodotSoftBody3D::set_collision_margin(real_t p_val) {}

void GodotSoftBody3D::set_linear_stiffness(real_t p_val) {}

void GodotSoftBody3D::set_pressure_coefficient(real_t p_val) {}

void GodotSoftBody3D::set_damping_coefficient(real_t p_val) {}

void GodotSoftBody3D::set_drag_coefficient(real_t p_val) {}

void GodotSoftBody3D::add_velocity(const Vector3 &p_velocity) {}

void GodotSoftBody3D::apply_forces(const LocalVector<GodotArea3D *> &p_wind_areas) {}

Vector3 GodotSoftBody3D::_compute_area_windforce(const GodotArea3D *p_area, const Face *p_face) {}

void GodotSoftBody3D::predict_motion(real_t p_delta) {}

void GodotSoftBody3D::solve_constraints(real_t p_delta) {}

void GodotSoftBody3D::solve_links(real_t kst, real_t ti) {}

struct AABBQueryResult {};

void GodotSoftBody3D::query_aabb(const AABB &p_aabb, GodotSoftBody3D::QueryResultCallback p_result_callback, void *p_userdata) {}

struct RayQueryResult {};

void GodotSoftBody3D::query_ray(const Vector3 &p_from, const Vector3 &p_to, GodotSoftBody3D::QueryResultCallback p_result_callback, void *p_userdata) {}

void GodotSoftBody3D::initialize_face_tree() {}

void GodotSoftBody3D::update_face_tree(real_t p_delta) {}

void GodotSoftBody3D::initialize_shape(bool p_force_move) {}

void GodotSoftBody3D::deinitialize_shape() {}

void GodotSoftBody3D::destroy() {}

void GodotSoftBodyShape3D::update_bounds() {}

GodotSoftBodyShape3D::GodotSoftBodyShape3D(GodotSoftBody3D *p_soft_body) {}

struct _SoftBodyIntersectSegmentInfo {};

bool GodotSoftBodyShape3D::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal, int &r_face_index, bool p_hit_back_faces) const {}

bool GodotSoftBodyShape3D::intersect_point(const Vector3 &p_point) const {}

Vector3 GodotSoftBodyShape3D::get_closest_point_to(const Vector3 &p_point) const {}