Coder Social home page Coder Social logo

Comments (8)

MikeFricker avatar MikeFricker commented on July 18, 2024

I'll try to answer since I don't know if Andrew is still supporting this. :)

You should be able to add the "BrickGrid" module as a dependency module to BrickGame.Build.cs. Even though BrickGrid is a module within a plugin, game projects are allowed to explicitly depend on plugin modules, which is needed if you want to inherit from types declared inside the plugin. You should then be able to include the public header files from that module. Public headers are any header files in the module's Classes or Public directories (BrickGridComponent.h is currently public.) Just keep in mind that some of the BrickGrid data structures may need to be "exported" to be able to link with them. You can do this by decorating those types with BRICKGRID_API. For example: struct BRICKGRID_API FBrickGridData.

--Mike

from brickgame.

AndrewScheidecker avatar AndrewScheidecker commented on July 18, 2024

Thanks Mike! I had a similar reply typed up, but then I got distracted making coffee and you beat me to it! :)

from brickgame.

spyd3rweb avatar spyd3rweb commented on July 18, 2024

Andrew,

While we're on the topic of utilizing/expanding the BrickGame plugin I was wondering if you would foresee any issues with using multiple BrickGrids in a scene?

Background:
I am working on a UE Voxelization plugin which takes static meshes and converts them to Voxel Octree Volumes. Currently I'm interfacing with the BrickGrid Plugin to render the Octrees in the single BrickGrid; however, I would like to create BrickGridActors which would have their own VoxelVolumes and BrickGridComponents and would render separately.

I realize the Ambient Occlusion calculations would also separate; however, I eventually plan on implementing Voxel Cone Tracing for illumination.

Thanks,

Aaron Blair

Sent from my iPhone

On Dec 11, 2014, at 8:59 AM, Andrew Scheidecker [email protected] wrote:

Thanks Mike! I had a similar reply typed up, but then I got distracted making coffee and you beat me to it! :)


Reply to this email directly or view it on GitHub.

from brickgame.

StenBone avatar StenBone commented on July 18, 2024

Thanks for the help Mike. You have got me halfway there. I changed my build file to include the "BrickGrid" module and I can now successfully include BrickGridComponent without getting any errors. Unfortunately, I am still getting an error where I am trying to use the struct.

The line I am having problems with is in my header file.
struct BRICKGRID_API BrickGridData data;

The error message says that my class uses undefined struct BrickGridData.

Am I missing something here?

from brickgame.

MikeFricker avatar MikeFricker commented on July 18, 2024

You only need the BRICKGRID_API in the header file that declared it. So you need to modify Andrew's original header file where the struct itself is declared (BrickGridComponent.h), not in your own project's source files. In some cases you might not even need to bother adding BRICKGRID_API. See if you get any link errors without adding that first.

from brickgame.

StenBone avatar StenBone commented on July 18, 2024

So I tried building it without BRICKGRID_API and then I tried it after adding BRICKGRID_API to the declared stuct in "BrickGridComponent.h". Both failed and gave a similar error message to the one before.

So just to give some background into what I am doing. I am trying to recreate some of the functionality found in projects blueprints in C++ code. I am doing this primarily for practice.

This is the code that I have so far for my BrickSaveGame class which is based of the BrickSaveGame blueprint. I don't really have anything in the source file so I will not post it.

It is also important to note that this class is in the BrickGame folder.

// Copyright 2014 Andrew Scheidecker

#pragma once

#include "GameFramework/SaveGame.h"
#include "BrickGridComponent.h"

#include "BrickSaveGame.generated.h"


/**
 * 
 */
UCLASS()
class BRICKGAME_API UBrickSaveGame : public USaveGame
{
    GENERATED_BODY()

private:

    struct BrickGridData data;


};

Please let me know if you need anymore details.

from brickgame.

AndrewScheidecker avatar AndrewScheidecker commented on July 18, 2024

spyd3rweb: Multiple BrickGridComponents should work fine, though I haven't tried it.

BloodHound27: I think you're just missing the F on FBrickGridData. You shouldn't need to add BRICKGRID_API anywhere if you're just reproducing the behavior of the blueprints. If you go beyond that you might run into some functions or classes I forgot to add it to, but if that happens, it goes on the declaration in the plugin.

from brickgame.

StenBone avatar StenBone commented on July 18, 2024

So, I finally had time to return to the the code and it turns out that you were right @AndrewScheidecker . It needed to be FBrickGridData. I am now closing this issue and pasting my working code.

// Copyright 2014 Andrew Scheidecker

#pragma once

#include "GameFramework/SaveGame.h"
#include "BrickGridComponent.h"

#include "BrickSaveGame.generated.h"


/**
 * 
 */
UCLASS()
class UBrickSaveGame : public USaveGame
{
    GENERATED_BODY()

private:

    struct FBrickGridData data;


};

Thank you @AndrewScheidecker and @MikeFricker for your help.

from brickgame.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.