godot/scene/resources/animation.cpp

/**************************************************************************/
/*  animation.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 "animation.h"
#include "animation.compat.inc"

#include "core/io/marshalls.h"
#include "core/math/geometry_3d.h"

bool Animation::_set(const StringName &p_name, const Variant &p_value) {}

bool Animation::_get(const StringName &p_name, Variant &r_ret) const {}

void Animation::_get_property_list(List<PropertyInfo> *p_list) const {}

void Animation::reset_state() {}

int Animation::add_track(TrackType p_type, int p_at_pos) {}

void Animation::remove_track(int p_track) {}

bool Animation::is_capture_included() const {}

void Animation::_check_capture_included() {}

int Animation::get_track_count() const {}

Animation::TrackType Animation::track_get_type(int p_track) const {}

void Animation::track_set_path(int p_track, const NodePath &p_path) {}

NodePath Animation::track_get_path(int p_track) const {}

int Animation::find_track(const NodePath &p_path, const TrackType p_type) const {}

Animation::TrackType Animation::get_cache_type(TrackType p_type) {}

void Animation::_track_update_hash(int p_track) {}

Animation::TypeHash Animation::track_get_type_hash(int p_track) const {}

void Animation::track_set_interpolation_type(int p_track, InterpolationType p_interp) {}

Animation::InterpolationType Animation::track_get_interpolation_type(int p_track) const {}

void Animation::track_set_interpolation_loop_wrap(int p_track, bool p_enable) {}

bool Animation::track_get_interpolation_loop_wrap(int p_track) const {}

template <typename T, typename V>
int Animation::_insert(double p_time, T &p_keys, const V &p_value) {}

int Animation::_marker_insert(double p_time, Vector<MarkerKey> &p_keys, const MarkerKey &p_value) {}

template <typename T>
void Animation::_clear(T &p_keys) {}

////

int Animation::position_track_insert_key(int p_track, double p_time, const Vector3 &p_position) {}

Error Animation::position_track_get_key(int p_track, int p_key, Vector3 *r_position) const {}

Error Animation::try_position_track_interpolate(int p_track, double p_time, Vector3 *r_interpolation, bool p_backward) const {}

Vector3 Animation::position_track_interpolate(int p_track, double p_time, bool p_backward) const {}

////

int Animation::rotation_track_insert_key(int p_track, double p_time, const Quaternion &p_rotation) {}

Error Animation::rotation_track_get_key(int p_track, int p_key, Quaternion *r_rotation) const {}

Error Animation::try_rotation_track_interpolate(int p_track, double p_time, Quaternion *r_interpolation, bool p_backward) const {}

Quaternion Animation::rotation_track_interpolate(int p_track, double p_time, bool p_backward) const {}

////

int Animation::scale_track_insert_key(int p_track, double p_time, const Vector3 &p_scale) {}

Error Animation::scale_track_get_key(int p_track, int p_key, Vector3 *r_scale) const {}

Error Animation::try_scale_track_interpolate(int p_track, double p_time, Vector3 *r_interpolation, bool p_backward) const {}

Vector3 Animation::scale_track_interpolate(int p_track, double p_time, bool p_backward) const {}

////

int Animation::blend_shape_track_insert_key(int p_track, double p_time, float p_blend_shape) {}

Error Animation::blend_shape_track_get_key(int p_track, int p_key, float *r_blend_shape) const {}

Error Animation::try_blend_shape_track_interpolate(int p_track, double p_time, float *r_interpolation, bool p_backward) const {}

float Animation::blend_shape_track_interpolate(int p_track, double p_time, bool p_backward) const {}

////

void Animation::track_remove_key_at_time(int p_track, double p_time) {}

void Animation::track_remove_key(int p_track, int p_idx) {}

int Animation::track_find_key(int p_track, double p_time, FindMode p_find_mode, bool p_limit, bool p_backward) const {}

int Animation::track_insert_key(int p_track, double p_time, const Variant &p_key, real_t p_transition) {}

int Animation::track_get_key_count(int p_track) const {}

Variant Animation::track_get_key_value(int p_track, int p_key_idx) const {}

double Animation::track_get_key_time(int p_track, int p_key_idx) const {}

void Animation::track_set_key_time(int p_track, int p_key_idx, double p_time) {}

real_t Animation::track_get_key_transition(int p_track, int p_key_idx) const {}

bool Animation::track_is_compressed(int p_track) const {}

void Animation::track_set_key_value(int p_track, int p_key_idx, const Variant &p_value) {}

void Animation::track_set_key_transition(int p_track, int p_key_idx, real_t p_transition) {}

template <typename K>
int Animation::_find(const Vector<K> &p_keys, double p_time, bool p_backward, bool p_limit) const {}

// Linear interpolation for anytype.

Vector3 Animation::_interpolate(const Vector3 &p_a, const Vector3 &p_b, real_t p_c) const {}

Quaternion Animation::_interpolate(const Quaternion &p_a, const Quaternion &p_b, real_t p_c) const {}

Variant Animation::_interpolate(const Variant &p_a, const Variant &p_b, real_t p_c) const {}

real_t Animation::_interpolate(const real_t &p_a, const real_t &p_b, real_t p_c) const {}

Variant Animation::_interpolate_angle(const Variant &p_a, const Variant &p_b, real_t p_c) const {}

// Cubic interpolation for anytype.

Vector3 Animation::_cubic_interpolate_in_time(const Vector3 &p_pre_a, const Vector3 &p_a, const Vector3 &p_b, const Vector3 &p_post_b, real_t p_c, real_t p_pre_a_t, real_t p_b_t, real_t p_post_b_t) const {}

Quaternion Animation::_cubic_interpolate_in_time(const Quaternion &p_pre_a, const Quaternion &p_a, const Quaternion &p_b, const Quaternion &p_post_b, real_t p_c, real_t p_pre_a_t, real_t p_b_t, real_t p_post_b_t) const {}

Variant Animation::_cubic_interpolate_in_time(const Variant &p_pre_a, const Variant &p_a, const Variant &p_b, const Variant &p_post_b, real_t p_c, real_t p_pre_a_t, real_t p_b_t, real_t p_post_b_t) const {}

real_t Animation::_cubic_interpolate_in_time(const real_t &p_pre_a, const real_t &p_a, const real_t &p_b, const real_t &p_post_b, real_t p_c, real_t p_pre_a_t, real_t p_b_t, real_t p_post_b_t) const {}

Variant Animation::_cubic_interpolate_angle_in_time(const Variant &p_pre_a, const Variant &p_a, const Variant &p_b, const Variant &p_post_b, real_t p_c, real_t p_pre_a_t, real_t p_b_t, real_t p_post_b_t) const {}

template <typename T>
T Animation::_interpolate(const Vector<TKey<T>> &p_keys, double p_time, InterpolationType p_interp, bool p_loop_wrap, bool *p_ok, bool p_backward) const {}

Variant Animation::value_track_interpolate(int p_track, double p_time, bool p_backward) const {}

void Animation::value_track_set_update_mode(int p_track, UpdateMode p_mode) {}

Animation::UpdateMode Animation::value_track_get_update_mode(int p_track) const {}

template <typename T>
void Animation::_track_get_key_indices_in_range(const Vector<T> &p_array, double from_time, double to_time, List<int> *p_indices, bool p_is_backward) const {}

void Animation::track_get_key_indices_in_range(int p_track, double p_time, double p_delta, List<int> *p_indices, Animation::LoopedFlag p_looped_flag) const {}

void Animation::add_marker(const StringName &p_name, double p_time) {}

void Animation::remove_marker(const StringName &p_name) {}

bool Animation::has_marker(const StringName &p_name) const {}

StringName Animation::get_marker_at_time(double p_time) const {}

StringName Animation::get_next_marker(double p_time) const {}

StringName Animation::get_prev_marker(double p_time) const {}

double Animation::get_marker_time(const StringName &p_name) const {}

PackedStringArray Animation::get_marker_names() const {}

Color Animation::get_marker_color(const StringName &p_name) const {}

void Animation::set_marker_color(const StringName &p_name, const Color &p_color) {}

Vector<Variant> Animation::method_track_get_params(int p_track, int p_key_idx) const {}

StringName Animation::method_track_get_name(int p_track, int p_key_idx) const {}

Array Animation::make_default_bezier_key(float p_value) {}

int Animation::bezier_track_insert_key(int p_track, double p_time, real_t p_value, const Vector2 &p_in_handle, const Vector2 &p_out_handle) {}

void Animation::bezier_track_set_key_value(int p_track, int p_index, real_t p_value) {}

void Animation::bezier_track_set_key_in_handle(int p_track, int p_index, const Vector2 &p_handle, real_t p_balanced_value_time_ratio) {}

void Animation::bezier_track_set_key_out_handle(int p_track, int p_index, const Vector2 &p_handle, real_t p_balanced_value_time_ratio) {}

real_t Animation::bezier_track_get_key_value(int p_track, int p_index) const {}

Vector2 Animation::bezier_track_get_key_in_handle(int p_track, int p_index) const {}

Vector2 Animation::bezier_track_get_key_out_handle(int p_track, int p_index) const {}

#ifdef TOOLS_ENABLED
void Animation::bezier_track_set_key_handle_mode(int p_track, int p_index, HandleMode p_mode, HandleSetMode p_set_mode) {}

Animation::HandleMode Animation::bezier_track_get_key_handle_mode(int p_track, int p_index) const {}
#endif // TOOLS_ENABLED

real_t Animation::bezier_track_interpolate(int p_track, double p_time) const {}

int Animation::audio_track_insert_key(int p_track, double p_time, const Ref<Resource> &p_stream, real_t p_start_offset, real_t p_end_offset) {}

void Animation::audio_track_set_key_stream(int p_track, int p_key, const Ref<Resource> &p_stream) {}

void Animation::audio_track_set_key_start_offset(int p_track, int p_key, real_t p_offset) {}

void Animation::audio_track_set_key_end_offset(int p_track, int p_key, real_t p_offset) {}

Ref<Resource> Animation::audio_track_get_key_stream(int p_track, int p_key) const {}

real_t Animation::audio_track_get_key_start_offset(int p_track, int p_key) const {}

real_t Animation::audio_track_get_key_end_offset(int p_track, int p_key) const {}

void Animation::audio_track_set_use_blend(int p_track, bool p_enable) {}

bool Animation::audio_track_is_use_blend(int p_track) const {}

//

int Animation::animation_track_insert_key(int p_track, double p_time, const StringName &p_animation) {}

void Animation::animation_track_set_key_animation(int p_track, int p_key, const StringName &p_animation) {}

StringName Animation::animation_track_get_key_animation(int p_track, int p_key) const {}

void Animation::set_length(real_t p_length) {}

real_t Animation::get_length() const {}

void Animation::set_loop_mode(Animation::LoopMode p_loop_mode) {}

Animation::LoopMode Animation::get_loop_mode() const {}

void Animation::track_set_imported(int p_track, bool p_imported) {}

bool Animation::track_is_imported(int p_track) const {}

void Animation::track_set_enabled(int p_track, bool p_enabled) {}

bool Animation::track_is_enabled(int p_track) const {}

void Animation::track_move_up(int p_track) {}

void Animation::track_move_down(int p_track) {}

void Animation::track_move_to(int p_track, int p_to_index) {}

void Animation::track_swap(int p_track, int p_with_track) {}

void Animation::set_step(real_t p_step) {}

real_t Animation::get_step() const {}

void Animation::copy_track(int p_track, Ref<Animation> p_to_animation) {}

void Animation::_bind_methods() {}

void Animation::clear() {}

bool Animation::_float_track_optimize_key(const TKey<float> t0, const TKey<float> t1, const TKey<float> t2, real_t p_allowed_velocity_err, real_t p_allowed_precision_error) {}

bool Animation::_vector2_track_optimize_key(const TKey<Vector2> t0, const TKey<Vector2> t1, const TKey<Vector2> t2, real_t p_allowed_velocity_err, real_t p_allowed_angular_error, real_t p_allowed_precision_error) {}

bool Animation::_vector3_track_optimize_key(const TKey<Vector3> t0, const TKey<Vector3> t1, const TKey<Vector3> t2, real_t p_allowed_velocity_err, real_t p_allowed_angular_error, real_t p_allowed_precision_error) {}

bool Animation::_quaternion_track_optimize_key(const TKey<Quaternion> t0, const TKey<Quaternion> t1, const TKey<Quaternion> t2, real_t p_allowed_velocity_err, real_t p_allowed_angular_error, real_t p_allowed_precision_error) {}

void Animation::_position_track_optimize(int p_idx, real_t p_allowed_velocity_err, real_t p_allowed_angular_err, real_t p_allowed_precision_error) {}

void Animation::_rotation_track_optimize(int p_idx, real_t p_allowed_velocity_err, real_t p_allowed_angular_err, real_t p_allowed_precision_error) {}

void Animation::_scale_track_optimize(int p_idx, real_t p_allowed_velocity_err, real_t p_allowed_angular_err, real_t p_allowed_precision_error) {}

void Animation::_blend_shape_track_optimize(int p_idx, real_t p_allowed_velocity_err, real_t p_allowed_precision_error) {}

void Animation::_value_track_optimize(int p_idx, real_t p_allowed_velocity_err, real_t p_allowed_angular_err, real_t p_allowed_precision_error) {}

void Animation::optimize(real_t p_allowed_velocity_err, real_t p_allowed_angular_err, int p_precision) {}

#define print_animc(m_str)
//#define print_animc(m_str) print_line(m_str);

struct AnimationCompressionDataState {};

struct AnimationCompressionTimeState {};

Vector3i Animation::_compress_key(uint32_t p_track, const AABB &p_bounds, int32_t p_key, float p_time) {}

struct AnimationCompressionBufferBitsRead {};

void Animation::compress(uint32_t p_page_size, uint32_t p_fps, float p_split_tolerance) {}

bool Animation::_rotation_interpolate_compressed(uint32_t p_compressed_track, double p_time, Quaternion &r_ret) const {}

bool Animation::_pos_scale_interpolate_compressed(uint32_t p_compressed_track, double p_time, Vector3 &r_ret) const {}
bool Animation::_blend_shape_interpolate_compressed(uint32_t p_compressed_track, double p_time, float &r_ret) const {}

template <uint32_t COMPONENTS>
bool Animation::_fetch_compressed(uint32_t p_compressed_track, double p_time, Vector3i &r_current_value, double &r_current_time, Vector3i &r_next_value, double &r_next_time, uint32_t *key_index) const {}

template <uint32_t COMPONENTS>
void Animation::_get_compressed_key_indices_in_range(uint32_t p_compressed_track, double p_time, double p_delta, List<int> *r_indices) const {}

int Animation::_get_compressed_key_count(uint32_t p_compressed_track) const {}

Quaternion Animation::_uncompress_quaternion(const Vector3i &p_value) const {}
Vector3 Animation::_uncompress_pos_scale(uint32_t p_compressed_track, const Vector3i &p_value) const {}
float Animation::_uncompress_blend_shape(const Vector3i &p_value) const {}

template <uint32_t COMPONENTS>
bool Animation::_fetch_compressed_by_index(uint32_t p_compressed_track, int p_index, Vector3i &r_value, double &r_time) const {}

// Helper math functions for Variant.
bool Animation::is_variant_interpolatable(const Variant p_value) {}

Variant Animation::cast_to_blendwise(const Variant p_value) {}

Variant Animation::cast_from_blendwise(const Variant p_value, const Variant::Type p_type) {}

Variant Animation::string_to_array(const Variant p_value) {}

Variant Animation::array_to_string(const Variant p_value) {}

Variant Animation::add_variant(const Variant &a, const Variant &b) {}

Variant Animation::subtract_variant(const Variant &a, const Variant &b) {}

Variant Animation::blend_variant(const Variant &a, const Variant &b, float c) {}

Variant Animation::interpolate_variant(const Variant &a, const Variant &b, float c, bool p_snap_array_element) {}

Variant Animation::cubic_interpolate_in_time_variant(const Variant &pre_a, const Variant &a, const Variant &b, const Variant &post_b, float c, real_t p_pre_a_t, real_t p_b_t, real_t p_post_b_t, bool p_snap_array_element) {}

bool Animation::inform_variant_array(int &r_min, int &r_max) {}

Animation::Animation() {}

Animation::~Animation() {}