@n1h/web-characters-cube-pets 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -2
- package/assets/License.txt +28 -0
- package/assets/Previews/animal-beaver.png +0 -0
- package/assets/Previews/animal-bee.png +0 -0
- package/assets/Previews/animal-bunny.png +0 -0
- package/assets/Previews/animal-cat.png +0 -0
- package/assets/Previews/animal-caterpillar.png +0 -0
- package/assets/Previews/animal-chick.png +0 -0
- package/assets/Previews/animal-cow.png +0 -0
- package/assets/Previews/animal-crab.png +0 -0
- package/assets/Previews/animal-deer.png +0 -0
- package/assets/Previews/animal-dog.png +0 -0
- package/assets/Previews/animal-elephant.png +0 -0
- package/assets/Previews/animal-fish.png +0 -0
- package/assets/Previews/animal-fox.png +0 -0
- package/assets/Previews/animal-giraffe.png +0 -0
- package/assets/Previews/animal-hog.png +0 -0
- package/assets/Previews/animal-koala.png +0 -0
- package/assets/Previews/animal-lion.png +0 -0
- package/assets/Previews/animal-monkey.png +0 -0
- package/assets/Previews/animal-panda.png +0 -0
- package/assets/Previews/animal-parrot.png +0 -0
- package/assets/Previews/animal-penguin.png +0 -0
- package/assets/Previews/animal-pig.png +0 -0
- package/assets/Previews/animal-polar.png +0 -0
- package/assets/Previews/animal-tiger.png +0 -0
- package/assets/Textures/colormap.png +0 -0
- package/assets/animal-beaver.glb +0 -0
- package/assets/animal-bee.glb +0 -0
- package/assets/animal-bunny.glb +0 -0
- package/assets/animal-cat.glb +0 -0
- package/assets/animal-caterpillar.glb +0 -0
- package/assets/animal-chick.glb +0 -0
- package/assets/animal-cow.glb +0 -0
- package/assets/animal-crab.glb +0 -0
- package/assets/animal-deer.glb +0 -0
- package/assets/animal-dog.glb +0 -0
- package/assets/animal-elephant.glb +0 -0
- package/assets/animal-fish.glb +0 -0
- package/assets/animal-fox.glb +0 -0
- package/assets/animal-giraffe.glb +0 -0
- package/assets/animal-hog.glb +0 -0
- package/assets/animal-koala.glb +0 -0
- package/assets/animal-lion.glb +0 -0
- package/assets/animal-monkey.glb +0 -0
- package/assets/animal-panda.glb +0 -0
- package/assets/animal-parrot.glb +0 -0
- package/assets/animal-penguin.glb +0 -0
- package/assets/animal-pig.glb +0 -0
- package/assets/animal-polar.glb +0 -0
- package/assets/animal-tiger.glb +0 -0
- package/package.json +33 -4
- package/src/beaver.ts +5 -0
- package/src/bee.ts +5 -0
- package/src/bunny.ts +5 -0
- package/src/cat.ts +5 -0
- package/src/caterpillar.ts +5 -0
- package/src/chick.ts +5 -0
- package/src/cow.ts +5 -0
- package/src/crab.ts +5 -0
- package/src/deer.ts +5 -0
- package/src/dog.ts +5 -0
- package/src/elephant.ts +5 -0
- package/src/fish.ts +5 -0
- package/src/fox.ts +5 -0
- package/src/giraffe.ts +5 -0
- package/src/hog.ts +5 -0
- package/src/index.ts +38 -0
- package/src/koala.ts +5 -0
- package/src/lion.ts +5 -0
- package/src/monkey.ts +5 -0
- package/src/panda.ts +5 -0
- package/src/parrot.ts +5 -0
- package/src/penguin.ts +5 -0
- package/src/pig.ts +5 -0
- package/src/polar.ts +5 -0
- package/src/spec.ts +77 -0
- package/src/tiger.ts +5 -0
package/README.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @n1h/web-characters-cube-pets
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Kenney's 24 [Cube Pets](https://kenney.nl/assets/cube-pets), [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/), as [`@n1h/web-characters`](https://github.com/n0t-invented-here/catwalk) models.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { cat } from "@n1h/web-characters-cube-pets/cat"; // one animal: its file and the shared texture
|
|
7
|
+
import { CUBE_PETS } from "@n1h/web-characters-cube-pets"; // all 24, by name
|
|
8
|
+
import { PETS, petLabel } from "@n1h/web-characters-cube-pets/spec"; // the names, without the files
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
- One module per animal, so a build ships only the animals a page imports.
|
|
12
|
+
- The animals: beaver, bee, bunny, cat, caterpillar, chick, cow, crab, deer, dog, elephant, fish, fox, giraffe, hog, koala, lion, monkey, panda, parrot, penguin, pig, polar, tiger.
|
|
13
|
+
- They idle, walk, run and dance. The chick, the parrot and the penguin also eat.
|
|
14
|
+
- Licence: [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/); Kenney's file is `assets/License.txt`.
|
|
15
|
+
|
|
16
|
+
Reference: [packs](https://github.com/n0t-invented-here/catwalk/blob/main/docs/packs.md).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
Cube Pets (2.0)
|
|
4
|
+
|
|
5
|
+
Created/distributed by Kenney (www.kenney.nl)
|
|
6
|
+
Creation date: 26-03-2026 11:16
|
|
7
|
+
|
|
8
|
+
------------------------------
|
|
9
|
+
|
|
10
|
+
License: (Creative Commons Zero, CC0)
|
|
11
|
+
http://creativecommons.org/publicdomain/zero/1.0/
|
|
12
|
+
|
|
13
|
+
You can use this content for personal, educational, and commercial purposes.
|
|
14
|
+
|
|
15
|
+
Support by crediting 'Kenney' or 'www.kenney.nl' (this is not a requirement)
|
|
16
|
+
|
|
17
|
+
------------------------------
|
|
18
|
+
|
|
19
|
+
• Website : www.kenney.nl
|
|
20
|
+
• Donate : www.kenney.nl/donate
|
|
21
|
+
|
|
22
|
+
• Patreon : patreon.com/kenney
|
|
23
|
+
|
|
24
|
+
Follow on social media for updates:
|
|
25
|
+
|
|
26
|
+
• Twitter: twitter.com/KenneyNL
|
|
27
|
+
• BlueSky: kenney.bsky.social
|
|
28
|
+
• Instagram: instagram.com/kenney_nl
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n1h/web-characters-cube-pets",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Kenney's 24 Cube Pets (CC0) as @n1h/web-characters models: one module per animal, so a build ships only the animals a page imports. The models, the shared texture and the licence are in the package.",
|
|
6
|
+
"license": "MIT OR 0BSD",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/n0t-invented-here/catwalk.git",
|
|
10
|
+
"directory": "packages/web-characters-cube-pets"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/n0t-invented-here/catwalk#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/n0t-invented-here/catwalk/issues"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"src",
|
|
18
|
+
"!src/**/*.test.ts",
|
|
19
|
+
"assets",
|
|
20
|
+
"README.md"
|
|
21
|
+
],
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
"exports": {
|
|
24
|
+
".": "./src/index.ts",
|
|
25
|
+
"./spec": "./src/spec.ts",
|
|
26
|
+
"./*": "./src/*.ts",
|
|
27
|
+
"./assets/*": "./assets/*"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"@n1h/web-characters": "^0.1.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@n1h/web-characters": "0.1.0"
|
|
34
|
+
}
|
|
35
|
+
}
|
package/src/beaver.ts
ADDED
package/src/bee.ts
ADDED
package/src/bunny.ts
ADDED
package/src/cat.ts
ADDED
package/src/chick.ts
ADDED
package/src/cow.ts
ADDED
package/src/crab.ts
ADDED
package/src/deer.ts
ADDED
package/src/dog.ts
ADDED
package/src/elephant.ts
ADDED
package/src/fish.ts
ADDED
package/src/fox.ts
ADDED
package/src/giraffe.ts
ADDED
package/src/hog.ts
ADDED
package/src/index.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="@n1h/web-characters/assets" />
|
|
2
|
+
// Kenney's Cube Pets, with their files. Each animal is its own module
|
|
3
|
+
// (`@n1h/web-characters-cube-pets/cat`), importing its own glTF, so a build
|
|
4
|
+
// that imports the cat ships the cat's file and nothing else of the pack.
|
|
5
|
+
// This module imports all 24, for a page that wants the whole pack and
|
|
6
|
+
// ships it.
|
|
7
|
+
|
|
8
|
+
import type { ModelSpec } from "@n1h/web-characters/model";
|
|
9
|
+
import type { Pet } from "./spec";
|
|
10
|
+
export { PETS, BIRDS, isBird, isPet, petLabel, randomPet, type Pet, type PetAnimation } from "./spec";
|
|
11
|
+
import { beaver } from "./beaver";
|
|
12
|
+
import { bee } from "./bee";
|
|
13
|
+
import { bunny } from "./bunny";
|
|
14
|
+
import { cat } from "./cat";
|
|
15
|
+
import { caterpillar } from "./caterpillar";
|
|
16
|
+
import { chick } from "./chick";
|
|
17
|
+
import { cow } from "./cow";
|
|
18
|
+
import { crab } from "./crab";
|
|
19
|
+
import { deer } from "./deer";
|
|
20
|
+
import { dog } from "./dog";
|
|
21
|
+
import { elephant } from "./elephant";
|
|
22
|
+
import { fish } from "./fish";
|
|
23
|
+
import { fox } from "./fox";
|
|
24
|
+
import { giraffe } from "./giraffe";
|
|
25
|
+
import { hog } from "./hog";
|
|
26
|
+
import { koala } from "./koala";
|
|
27
|
+
import { lion } from "./lion";
|
|
28
|
+
import { monkey } from "./monkey";
|
|
29
|
+
import { panda } from "./panda";
|
|
30
|
+
import { parrot } from "./parrot";
|
|
31
|
+
import { penguin } from "./penguin";
|
|
32
|
+
import { pig } from "./pig";
|
|
33
|
+
import { polar } from "./polar";
|
|
34
|
+
import { tiger } from "./tiger";
|
|
35
|
+
|
|
36
|
+
export { beaver, bee, bunny, cat, caterpillar, chick, cow, crab, deer, dog, elephant, fish, fox, giraffe, hog, koala, lion, monkey, panda, parrot, penguin, pig, polar, tiger };
|
|
37
|
+
|
|
38
|
+
export const CUBE_PETS: Readonly<Record<Pet, ModelSpec>> = { beaver, bee, bunny, cat, caterpillar, chick, cow, crab, deer, dog, elephant, fish, fox, giraffe, hog, koala, lion, monkey, panda, parrot, penguin, pig, polar, tiger };
|
package/src/koala.ts
ADDED
package/src/lion.ts
ADDED
package/src/monkey.ts
ADDED
package/src/panda.ts
ADDED
package/src/parrot.ts
ADDED
package/src/penguin.ts
ADDED
package/src/pig.ts
ADDED
package/src/polar.ts
ADDED
package/src/spec.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// Kenney's Cube Pets (CC0): 24 animals, one glTF each, all sharing one
|
|
2
|
+
// texture and the same eight clips. This module is the pack as data with no
|
|
3
|
+
// files in it: the names, the labels, the file names, which are birds, and
|
|
4
|
+
// the moods; each animal's module adds its file.
|
|
5
|
+
|
|
6
|
+
import type { ModelSpec, MoodSpec } from "@n1h/web-characters/model";
|
|
7
|
+
|
|
8
|
+
export const PETS = [
|
|
9
|
+
"beaver",
|
|
10
|
+
"bee",
|
|
11
|
+
"bunny",
|
|
12
|
+
"cat",
|
|
13
|
+
"caterpillar",
|
|
14
|
+
"chick",
|
|
15
|
+
"cow",
|
|
16
|
+
"crab",
|
|
17
|
+
"deer",
|
|
18
|
+
"dog",
|
|
19
|
+
"elephant",
|
|
20
|
+
"fish",
|
|
21
|
+
"fox",
|
|
22
|
+
"giraffe",
|
|
23
|
+
"hog",
|
|
24
|
+
"koala",
|
|
25
|
+
"lion",
|
|
26
|
+
"monkey",
|
|
27
|
+
"panda",
|
|
28
|
+
"parrot",
|
|
29
|
+
"penguin",
|
|
30
|
+
"pig",
|
|
31
|
+
"polar",
|
|
32
|
+
"tiger",
|
|
33
|
+
] as const;
|
|
34
|
+
|
|
35
|
+
export type Pet = (typeof PETS)[number];
|
|
36
|
+
|
|
37
|
+
/** Every model has these, by name, in its animation groups. */
|
|
38
|
+
export type PetAnimation = "static" | "idle" | "walk" | "run" | "eat" | "dance" | "gesture-positive" | "gesture-negative";
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The birds. The shared `eat` animation is a dip of the head to the ground,
|
|
42
|
+
* which reads as pecking: right on these, wrong on everything else, so only
|
|
43
|
+
* the birds ever play it.
|
|
44
|
+
*/
|
|
45
|
+
export const BIRDS: ReadonlySet<Pet> = new Set<Pet>(["chick", "parrot", "penguin"]);
|
|
46
|
+
export const isBird = (pet: Pet): boolean => BIRDS.has(pet);
|
|
47
|
+
|
|
48
|
+
export const petLabel = (pet: Pet): string => (pet === "polar" ? "Polar bear" : pet[0]!.toUpperCase() + pet.slice(1));
|
|
49
|
+
export const isPet = (name: unknown): name is Pet => typeof name === "string" && (PETS as readonly string[]).includes(name);
|
|
50
|
+
export const randomPet = (): Pet => PETS[Math.floor(Math.random() * PETS.length)]!;
|
|
51
|
+
|
|
52
|
+
/** A pet's model file, relative to the pack folder (assets). */
|
|
53
|
+
export const petModelFile = (pet: Pet): string => `animal-${pet}.glb`;
|
|
54
|
+
/** The one texture every model references, relative to the pack folder; the models reference it by this path. */
|
|
55
|
+
export const PET_TEXTURE_FILE = "Textures/colormap.png";
|
|
56
|
+
/** Kenney's own 64x64 render of a pet, relative to the pack folder. */
|
|
57
|
+
export const petPreviewFile = (pet: Pet): string => `Previews/animal-${pet}.png`;
|
|
58
|
+
|
|
59
|
+
/** What the pets do on the ground, as the moods' names. `eat` is pecking: the birds get it, nobody else does. */
|
|
60
|
+
export type Mood = "idle" | "walk" | "run" | "eat" | "dance";
|
|
61
|
+
|
|
62
|
+
export const cubePetMoods = (pet: Pet): MoodSpec[] => [
|
|
63
|
+
{ name: "idle", clip: "idle", weight: 2, seconds: [2, 6] },
|
|
64
|
+
{ name: "walk", clip: "walk", weight: 3, speed: 55, seconds: [3, 8] }, // 55 px/s at scale 1, matched to the walk cycle
|
|
65
|
+
{ name: "run", clip: "run", weight: 1, speed: 150, seconds: [1.5, 3.5] },
|
|
66
|
+
{ name: "dance", clip: "dance", weight: 1, seconds: [3, 6] },
|
|
67
|
+
...(isBird(pet) ? [{ name: "eat", clip: "eat", weight: 2, seconds: [2, 6] as [number, number] }] : []),
|
|
68
|
+
];
|
|
69
|
+
|
|
70
|
+
/** The spec for a pet whose file (and the shared texture) is at these URLs. */
|
|
71
|
+
export const cubePetSpec = (pet: Pet, url: string, textures: Record<string, string>): ModelSpec => ({
|
|
72
|
+
name: petLabel(pet),
|
|
73
|
+
url,
|
|
74
|
+
textures,
|
|
75
|
+
clips: { idle: "idle", carried: "gesture-negative", falling: "gesture-negative", landed: "gesture-positive" },
|
|
76
|
+
moods: cubePetMoods(pet),
|
|
77
|
+
});
|
package/src/tiger.ts
ADDED