orangeduck / Motion-Matching

Learned Motion Matching example implementation and source code for the article "Code vs Data Driven Displacement"
MIT License
698 stars 105 forks source link

Again Makefile for build in Linux ::) #1

Open blogdron opened 3 years ago

blogdron commented 3 years ago

Use make build_depends && make mmatching && make run

CC=g++
INCLUDE_DIR = -I./
INCLUDE_DIR+= -I./depends/raylib/raylib/include
INCLUDE_DIR+= -I./depends/raygui/src
LIBRARY_DIR = -L./depends/raylib/raylib
LIBRARY_DIR+= -L./depends/raylib/raylib/external/glfw/src
LIBRARY_LINK = -lraylib -lglfw3 -ldl -pthread
BUILD_DEP = $(INCLUDE_DIR) $(LIBRARY_DIR) $(LIBRARY_LINK)

all: mmatching

clean:
    -rm mmatching

mmatching:
    $(CC) controller.c -o $@ $(BUILD_DEP)

run:
    ./mmatching;

build_depends:
    mkdir -p depends/raygui
    mkdir -p depends/raylib
    git clone --depth 1 https://github.com/raysan5/raylib.git depends/raylib
    git clone --depth 1 https://github.com/raysan5/raygui depends/raygui
    cd depends/raylib && cmake . && make

patch-back:
    mv controller.old.c controller.c

.SILENT: clean

P.S.:

Im not have gamepad :( If you don't, then you can apply a patch. Only move and zoom works. The rest I did not touch. Basic keyboard support -> https://gist.github.com/fedor-elizarov/2a14307a34112f8d605ee2198855b8af

wasd move key pad 1 zoom in key pad 2 zoom out You need to apply a patch for it. Maybe it will be useful to someone

bmahlbrand commented 3 years ago

My xbox one controller didn't work ootb, but I'm not sure if it should on Linux :) -- appears to be related to either raylib's input system or more likely glfw's gamepad bindings.

blogdron commented 3 years ago

@bmahlbrand Follow the patch link, apply it to get the ability to control the character from keyboard. If you do not know how to apply patches, then simply remove the red lines from the source and add the green ones manually and rebuild the source.

Or check this https://packages.debian.org/sid/xboxdrv As far as I understand, this controller will only work after some actions

bbagwang commented 3 years ago

There is something missing in the last line.

It should be something like this.

.SILENT:clean

blogdron commented 3 years ago

@bbagwang thanks ::)