Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/pointcache.c
| Show First 20 Lines • Show All 380 Lines • ▼ Show 20 Lines | if (keys[1].time > keys[2].time) { | ||||
| mul_v3_fl(keys[2].vel, (keys[1].time - keys[2].time) * timestep); | mul_v3_fl(keys[2].vel, (keys[1].time - keys[2].time) * timestep); | ||||
| } | } | ||||
| else { | else { | ||||
| sub_v3_v3v3(keys[2].vel, keys[2].co, keys[1].co); | sub_v3_v3v3(keys[2].vel, keys[2].co, keys[1].co); | ||||
| mul_v3_fl(keys[2].vel, (keys[2].time - keys[1].time) * timestep); | mul_v3_fl(keys[2].vel, (keys[2].time - keys[1].time) * timestep); | ||||
| } | } | ||||
| } | } | ||||
| /* determine rotation from velocity */ | /* default to no rotation */ | ||||
| if (data[BPHYS_DATA_LOCATION] && !data[BPHYS_DATA_ROTATION]) { | if (data[BPHYS_DATA_LOCATION] && !data[BPHYS_DATA_ROTATION]) { | ||||
| vec_to_quat(keys[2].rot, keys[2].vel, OB_NEGX, OB_POSZ); | unit_qt(keys[2].rot); | ||||
| } | } | ||||
| if (cfra > pa->time) | if (cfra > pa->time) | ||||
| cfra1 = MAX2(cfra1, pa->time); | cfra1 = MAX2(cfra1, pa->time); | ||||
| dfra = cfra2 - cfra1; | dfra = cfra2 - cfra1; | ||||
| mul_v3_fl(keys[1].vel, dfra * timestep); | mul_v3_fl(keys[1].vel, dfra * timestep); | ||||
| ▲ Show 20 Lines • Show All 3,689 Lines • Show Last 20 Lines | |||||