Ruined
This commit is contained in:
+14
-2
@@ -114,14 +114,26 @@ function pose(name, frame) {
|
||||
cx*sy*cz + sx*cy*sz, cx*cy*sz - sx*sy*cz]};
|
||||
}
|
||||
|
||||
export const BODY_PROFILES = Object.freeze(['compact', 'balanced', 'broad']);
|
||||
export const BODY_PROFILES = Object.freeze(['compact', 'lean', 'balanced', 'broad', 'sturdy']);
|
||||
export function playerB3D(profile = 'balanced') {
|
||||
if (!BODY_PROFILES.includes(profile)) throw new Error('Unknown character body profile.');
|
||||
const width = {compact: .92, balanced: 1, broad: 1.08}[profile];
|
||||
const width = {compact: .86, lean: .93, balanced: 1, broad: 1.08, sturdy: 1.16}[profile];
|
||||
const vertices = [], triangles = [], weights = Object.fromEntries(skeleton.map(b => [b.name, []]));
|
||||
box(vertices, triangles, weights, 'Body', [-2.15*width,8,-1.18,2.15*width,13.5,1.18],
|
||||
['back','tunic','tunic','tunic','tunic','tunic'], [profile === 'broad' ? .9 : .86, .86]);
|
||||
box(vertices, triangles, weights, 'Head', [-1.6,13.5,-1.4,1.6,PLAYER_HEIGHT,1.4], ['hair','face','skin','hair','side','side']);
|
||||
// Original layered fieldwear: separate low-poly mantle, belt and satchel
|
||||
// keep the survivor readable at a distance without changing their hitbox.
|
||||
box(vertices, triangles, weights, 'Body', [-2.15*width,1.2,-1.58,2.15*width,11.8,-1.22],
|
||||
['back','back','back','back','back','back'], [profile === 'broad' ? .94 : .88, .92]);
|
||||
box(vertices, triangles, weights, 'Body', [-2.2*width,8.05,-1.25,2.2*width,9.05,1.25],
|
||||
['wrap','wrap','wrap','wrap','wrap','wrap']);
|
||||
box(vertices, triangles, weights, 'Body', [1.35*width,3.8,-1.9,3.35*width,7.9,-1.43],
|
||||
['wood','wrap','wood','wood','wood','wrap'], [.9,.92]);
|
||||
box(vertices, triangles, weights, 'Head', [-.32,14.2,1.2,.32,15.1,1.5],
|
||||
['skin','skin','skin','skin','skin','skin'], [.68,.7]);
|
||||
for (const side of [-1,1]) box(vertices, triangles, weights, 'Head',
|
||||
[side<0?-1.6:1.34,14.6,-.15,side<0?-1.34:1.6,15.5,.75], 'skin', [.7,.8]);
|
||||
for (const [side, sign] of [['Right', -1], ['Left', 1]]) {
|
||||
const x = sign * 3.1;
|
||||
box(vertices, triangles, weights, `Arm_${side}`, [x-.78*width,8.6,-.84,x+.78*width,13,.84], 'sleeve', [.9,.95]);
|
||||
|
||||
Reference in New Issue
Block a user