Blender  V3.3
Functions | Variables
anim_path.c File Reference
#include "MEM_guardedalloc.h"
#include <float.h>
#include "DNA_curve_types.h"
#include "DNA_key_types.h"
#include "DNA_object_types.h"
#include "BLI_math_vector.h"
#include "BKE_anim_path.h"
#include "BKE_curve.h"
#include "BKE_key.h"
#include "CLG_log.h"

Go to the source code of this file.

Functions

static int get_bevlist_seg_array_size (const BevList *bl)
 
int BKE_anim_path_get_array_size (const CurveCache *curve_cache)
 
float BKE_anim_path_get_length (const CurveCache *curve_cache)
 
void BKE_anim_path_calc_data (Object *ob)
 
static void get_curve_points_from_idx (const int idx, const BevList *bl, const bool is_cyclic, BevPoint const **r_p0, BevPoint const **r_p1, BevPoint const **r_p2, BevPoint const **r_p3)
 
static bool binary_search_anim_path (const float *accum_len_arr, const int seg_size, const float goal_len, int *r_idx, float *r_frac)
 
bool BKE_where_on_path (const Object *ob, float ctime, float r_vec[4], float r_dir[3], float r_quat[4], float *r_radius, float *r_weight)
 

Variables

static CLG_LogRef LOG = {"bke.anim"}
 

Function Documentation

◆ binary_search_anim_path()

static bool binary_search_anim_path ( const float accum_len_arr,
const int  seg_size,
const float  goal_len,
int *  r_idx,
float r_frac 
)
static

Definition at line 173 of file anim_path.c.

References BLI_assert_msg, CLOG_ERROR, LOG, and UNLIKELY.

Referenced by BKE_where_on_path().

◆ BKE_anim_path_calc_data()

void BKE_anim_path_calc_data ( struct Object ob)

This function populates the 'ob->runtime.curve_cache->anim_path_accum_length' data. You should never have to call this manually as it should already have been called by 'BKE_displist_make_curveTypes'. Do not call this manually unless you know what you are doing.

Definition at line 56 of file anim_path.c.

References CurveCache::anim_path_accum_length, CurveCache::bev, BevList::bevpoints, BLI_assert, CLOG_WARN, Object_Runtime::curve_cache, ListBase::first, get_bevlist_seg_array_size(), len_v3v3(), LOG, MEM_freeN, MEM_mallocN, BevList::nr, NULL, OB_CURVES_LEGACY, BevList::poly, Object::runtime, Object::type, and BevPoint::vec.

Referenced by evaluate_curve_type_object().

◆ BKE_anim_path_get_array_size()

int BKE_anim_path_get_array_size ( const CurveCache curve_cache)

◆ BKE_anim_path_get_length()

float BKE_anim_path_get_length ( const CurveCache curve_cache)

◆ BKE_where_on_path()

bool BKE_where_on_path ( const Object ob,
float  ctime,
float  r_vec[4],
float  r_dir[3],
float  r_quat[4],
float r_radius,
float r_weight 
)

◆ get_bevlist_seg_array_size()

static int get_bevlist_seg_array_size ( const BevList bl)
static

Definition at line 29 of file anim_path.c.

References BevList::nr, and BevList::poly.

Referenced by BKE_anim_path_calc_data(), BKE_anim_path_get_array_size(), and BKE_where_on_path().

◆ get_curve_points_from_idx()

static void get_curve_points_from_idx ( const int  idx,
const BevList bl,
const bool  is_cyclic,
BevPoint const **  r_p0,
BevPoint const **  r_p1,
BevPoint const **  r_p2,
BevPoint const **  r_p3 
)
static

Definition at line 100 of file anim_path.c.

References BevList::bevpoints, BLI_assert, is_cyclic(), and BevList::nr.

Referenced by BKE_where_on_path().

Variable Documentation

◆ LOG

CLG_LogRef LOG = {"bke.anim"}
static

Definition at line 24 of file anim_path.c.

Referenced by binary_search_anim_path(), BKE_anim_path_calc_data(), and BKE_where_on_path().