vpGetMaterial(3)

πŸ“¦ version 1.0c7, in fedora 43, fedora 44

πŸ’– vpGetMaterial(3) πŸ’–

okay so bestie, welcome to the Library Functions Manual page for vpGetMaterial β€” yes she's a section 3 girlie, we love that for her πŸŽ€


✨ NAME ✨

vpGetMaterial β€” get material properties πŸ’…


🌸 SYNOPSIS 🌸

#include <volpack.h>

vpResult
vpGetMaterial(vpc, material, property, surface_side, r_ptr, g_ptr,
        b_ptr)
    vpContext *vpc;
    int material;
    int property;
    int surface_side;
    double *r_ptr, *g_ptr, *b_ptr;

πŸ¦‹ ARGUMENTS πŸ¦‹

  • vpc β€” the VolPack context you got from vpCreateContext. ur main character, fr fr 🫢
  • material β€” a constant that says which material number we're talking about: VP_MATERIAL0, VP_MATERIAL1, ..., all the way up to VP_MATERIAL5. pick ur fave πŸ’–
  • property β€” a constant naming exactly one material property: VP_AMBIENT, VP_DIFFUSE, VP_SPECULAR or VP_SHINYNESS. one (1) property only, no greedy behaviour πŸ™ˆ
  • surface_side β€” a constant picking one side of the material surface: VP_EXTERIOR or VP_INTERIOR. (yes only one side, we'll get to that πŸ‘€)
  • r_ptr, g_ptr, b_ptr β€” the locations where we store the RGB components of the color that goes with the property. and lowkey important: for VP_SHINYNESS, g_ptr and b_ptr are not used. like at all. they're just vibing there unused πŸ’€

🌈 DESCRIPTION 🌈

So vpGetMaterial is the function you call when you wanna get the properties of a material type. It's the read-only bestie to vpSetMaterial's write energy ✨

The arguments are exactly analogous to vpSetMaterial β€” same shape, same vibes β€” with two lil twists that you need to clock:

  1. the surface_side argument may not be VP_BOTH_SIDES. nope. not allowed. pick a side, bestie, we're not doing both 😀
  2. the final three arguments are pointers to locations where the material properties get stored. so it's writing into ur variables, not reading out of them πŸ“₯
no cap: this is a getter, so those pointers are where the answers land. make sure they point somewhere real πŸ’œ

😭 ERRORS 😭

the normal return value is VP_OK. that's the slay, the ate, the iconic outcome πŸ‘‘

but if things go sideways, here are the error return values that are possible:

  • VPERROR_BAD_VALUE β€” the material number is invalid. like, that material does not exist, bestie, stop it πŸ™ˆ
  • VPERROR_BAD_OPTION β€” either the surface_side or property arguments are invalid. one of them is giving nonsense and we're not here for it πŸ’€

🧚 SEE ALSO 🧚


and that's the whole page, periodt πŸ’…βœ¨

this one ships with VolPack (that's the source/version energy at the bottom of the original page) and it's filed under vpGetMaterial(3) β€” so go forth, grab ur material properties, and stay iconic πŸŽ€πŸ’–πŸŒΈπŸ¦‹πŸ‘‘

πŸ“¦ where this page comes from