Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/softbody.c
| Context not available. | |||||
| #include <stdlib.h> | #include <stdlib.h> | ||||
| #include <string.h> | #include <string.h> | ||||
| #include "CLG_log.h" | |||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| /* types */ | /* types */ | ||||
| Context not available. | |||||
| #include "PIL_time.h" | #include "PIL_time.h" | ||||
| static CLG_LogRef LOG = { "bke.softbody" }; | |||||
| /* callbacks for errors and interrupts and some goo */ | /* callbacks for errors and interrupts and some goo */ | ||||
| static int (*SB_localInterruptCallBack)(void) = NULL; | static int (*SB_localInterruptCallBack)(void) = NULL; | ||||
| Context not available. | |||||
| return (f); | return (f); | ||||
| } | } | ||||
| } | } | ||||
| printf("_final_goal failed! sb or bp ==NULL\n"); | CLOG_ERROR(&LOG, "sb or bp == NULL"); | ||||
| return f; /*using crude but spot able values some times helps debuggin */ | return f; /*using crude but spot able values some times helps debuggin */ | ||||
| } | } | ||||
| Context not available. | |||||
| return(bp->mass*sb->nodemass); | return(bp->mass*sb->nodemass); | ||||
| } | } | ||||
| } | } | ||||
| printf("_final_mass failed! sb or bp ==NULL\n"); | CLOG_ERROR(&LOG, "sb or bp == NULL"); | ||||
| return 1.0f; | return 1.0f; | ||||
| } | } | ||||
| /* helper functions for everything is animateble jow_go_for2_5 ------*/ | /* helper functions for everything is animateble jow_go_for2_5 ------*/ | ||||
| Context not available. | |||||
| notthis = bs->v1; | notthis = bs->v1; | ||||
| } | } | ||||
| else { | else { | ||||
| printf("oops we should not get here - add_2nd_order_springs"); | CLOG_ERROR(&LOG, "oops we should not get here"); | ||||
| } | } | ||||
| } | } | ||||
| if (bpo) {/* so now we have a 2nd order humpdidump */ | if (bpo) {/* so now we have a 2nd order humpdidump */ | ||||
| Context not available. | |||||
| } | } | ||||
| else { | else { | ||||
| /*aye that should be cached*/ | /*aye that should be cached*/ | ||||
| printf("missing cache error\n"); | CLOG_ERROR(&LOG, "missing cache error"); | ||||
| BLI_ghashIterator_step(ihash); | BLI_ghashIterator_step(ihash); | ||||
| continue; | continue; | ||||
| } | } | ||||
| Context not available. | |||||
| } | } | ||||
| else { | else { | ||||
| /*aye that should be cached*/ | /*aye that should be cached*/ | ||||
| printf("missing cache error\n"); | CLOG_ERROR(&LOG, "missing cache error"); | ||||
| BLI_ghashIterator_step(ihash); | BLI_ghashIterator_step(ihash); | ||||
| continue; | continue; | ||||
| } | } | ||||
| Context not available. | |||||
| } | } | ||||
| else { | else { | ||||
| /*aye that should be cached*/ | /*aye that should be cached*/ | ||||
| printf("missing cache error\n"); | CLOG_ERROR(&LOG, "missing cache error"); | ||||
| BLI_ghashIterator_step(ihash); | BLI_ghashIterator_step(ihash); | ||||
| continue; | continue; | ||||
| } | } | ||||
| Context not available. | |||||
| } | } | ||||
| else { | else { | ||||
| /*aye that should be cached*/ | /*aye that should be cached*/ | ||||
| printf("missing cache error\n"); | CLOG_ERROR(&LOG, "missing cache error"); | ||||
| BLI_ghashIterator_step(ihash); | BLI_ghashIterator_step(ihash); | ||||
| continue; | continue; | ||||
| } | } | ||||
| Context not available. | |||||
| } | } | ||||
| else { | else { | ||||
| /*aye that should be cached*/ | /*aye that should be cached*/ | ||||
| printf("missing cache error\n"); | CLOG_ERROR(&LOG, "missing cache error"); | ||||
| BLI_ghashIterator_step(ihash); | BLI_ghashIterator_step(ihash); | ||||
| continue; | continue; | ||||
| } | } | ||||
| Context not available. | |||||
| else { | else { | ||||
| /* TODO make this debug option */ | /* TODO make this debug option */ | ||||
| /**/ | /**/ | ||||
| printf("bodypoint <bpi> is not attached to spring <*bs> --> sb_spring_force()\n"); | CLOG_WARN(&LOG, "bodypoint <bpi> is not attached to spring <*bs>"); | ||||
| return; | return; | ||||
| } | } | ||||
| Context not available. | |||||
| float iks; | float iks; | ||||
| int bb, do_selfcollision, do_springcollision, do_aero; | int bb, do_selfcollision, do_springcollision, do_aero; | ||||
| int number_of_points_here = ilast - ifirst; | int number_of_points_here = ilast - ifirst; | ||||
| SoftBody *sb= ob->soft; /* is supposed to be there */ | SoftBody *sb = ob->soft; /* is supposed to be there */ | ||||
| BodyPoint *bp; | BodyPoint *bp; | ||||
| /* initialize */ | /* initialize */ | ||||
| Context not available. | |||||
| /* --- could be done on object level to squeeze out the last bits of it */ | /* --- could be done on object level to squeeze out the last bits of it */ | ||||
| } | } | ||||
| else { | else { | ||||
| printf("Error expected a SB here\n"); | CLOG_ERROR(&LOG, "expected a SB here"); | ||||
| return (999); | return (999); | ||||
| } | } | ||||
| Context not available. | |||||
| }/*SOLVER SELECT*/ | }/*SOLVER SELECT*/ | ||||
| else { | else { | ||||
| printf("softbody no valid solver ID!"); | CLOG_ERROR(&LOG, "softbody no valid solver ID!"); | ||||
| }/*SOLVER SELECT*/ | }/*SOLVER SELECT*/ | ||||
| if (sb->plastic) { apply_spring_memory(ob);} | if (sb->plastic) { apply_spring_memory(ob);} | ||||
| Context not available. | |||||